From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757608AbcIZI1S (ORCPT ); Mon, 26 Sep 2016 04:27:18 -0400 Received: from mga14.intel.com ([192.55.52.115]:1358 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756735AbcIZI1M (ORCPT ); Mon, 26 Sep 2016 04:27:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,398,1470726000"; d="scan'208";a="1062311249" From: Alexander Shishkin To: Peter Zijlstra , Andi Kleen Cc: Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo , tglx@linutronix.de Subject: Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation In-Reply-To: <20160923202830.GQ5008@twins.programming.kicks-ass.net> References: <20160923112726.5890-1-alexander.shishkin@linux.intel.com> <20160923112726.5890-2-alexander.shishkin@linux.intel.com> <20160923121403.GC5012@twins.programming.kicks-ass.net> <20160923172615.GU3078@tassilo.jf.intel.com> <20160923202830.GQ5008@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 26 Sep 2016 11:27:08 +0300 Message-ID: <878tufrrqb.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > Well, we could 'force' inject a VMA into the process's address space, we > do that for a few other things as well. It also makes for less > exceptions with the actual core dumping. Threads then will end up with the same buffer (through sharing the mm), but they can't really share trace buffers. Also, system core dump is still a problem. > But the worry I have is the total amount of pinned memory. If you want > to inherit this on fork(), as is a reasonable expectation, then its > possible to quickly exceed the total amount of pinnable memory. > > At which point we _should_ start failing fork(), which is a somewhat > unexpected, and undesirable side-effect. I'm not sure I see why we should fail fork() when we run out of pinned memory. > Ideally we'd unpin the old buffers and repin the new buffers on context > switch, but that's impossible since faulting needs scheduling, > recursion, we loose. Or we can have per-cpu buffers for all user's tasks, record where each task starts and ends in each buffer and cut out only bits relevant to the task(s) that dump core. Regards, -- Alex