From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbdJCOnm (ORCPT ); Tue, 3 Oct 2017 10:43:42 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:53017 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbdJCOnk (ORCPT ); Tue, 3 Oct 2017 10:43:40 -0400 Date: Tue, 3 Oct 2017 16:43:35 +0200 From: Peter Zijlstra To: Alexander Shishkin Cc: Ingo Molnar , linux-kernel@vger.kernel.org, acme@redhat.com, kirill.shutemov@linux.intel.com, Borislav Petkov , rric@kernel.org Subject: Re: [RFC PATCH 09/17] perf: Use shmemfs pages for userspace-only per-thread detached events Message-ID: <20171003144335.jqsraoqn2zskv2xd@hirez.programming.kicks-ass.net> References: <20170905133026.13689-1-alexander.shishkin@linux.intel.com> <20170905133026.13689-10-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170905133026.13689-10-alexander.shishkin@linux.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 05, 2017 at 04:30:18PM +0300, Alexander Shishkin wrote: > In order to work around the problem of using up mlocked memory for the > detached events, we can pin the ring buffer pages only while they are > in use (that is, the event is ACTIVE), and unpin them for the rest of > the time. When not pinned in, these pages can be swapped out. This way, > one user can have at most mlock_limit*nr_cpus kB of memory pinned at > any given moment, however many events they actually have. > > This enforces a constraint: pinning and unpinning may sleep and thus > can't be done in the event scheduling path. Instead, we use a task > work to do this, which this pattern us to userspace-only events. > Also, since one userspace thread only needs one buffer (for whatever > CPU it's running on at any given moment), we only do this for per-thread > events. > > The source for such swappable pages is shmemfs. This patch allows > allocating perf ring buffer pages from an shmemfs file if the above > constraints are met. Right, so why still allow that previous icky thing? What cases do we need that for?