From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034645AbcIWP7E (ORCPT ); Fri, 23 Sep 2016 11:59:04 -0400 Received: from mga03.intel.com ([134.134.136.65]:19643 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758649AbcIWP7B (ORCPT ); Fri, 23 Sep 2016 11:59:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,382,1470726000"; d="scan'208";a="883111732" From: Alexander Shishkin To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo , tglx@linutronix.de, ak@linux.intel.com Subject: Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation In-Reply-To: <20160923152737.GN5008@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> <8737kqu1x1.fsf@ashishki-desk.ger.corp.intel.com> <20160923152737.GN5008@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 23 Sep 2016 18:58:57 +0300 Message-ID: <87zimysj3y.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: > On Fri, Sep 23, 2016 at 05:27:22PM +0300, Alexander Shishkin wrote: >> > Afaict there's no actual need to hide the AUX buffer for this sampling >> > stuff; the user knows about all this and can simply mmap() the AUX part. >> >> Yes, you're right here. We could also re-use the AUX record, adding a >> new flag for this. It may be even better if I can work out the >> inheritance (the current code doesn't handle inheritance at the moment >> in case we decide to scrap it). > > What is the exact problem with inheritance? You can inherit PT (and > other) events just fine, and their output redirects to the original > (AUX) buffer too. > > Is the problem untangling which part of the AUX buffer belongs to which > task upon sample? Tasks we can figure out from id samples on RECORD_AUX (assuming we're using those), but which event (if you have multiple) does a sample belong to is trickier. Cutting out samples becomes more interesting as normally RECORD_AUX don't overlap, we can keep it that way and then the samples will naturally be non-overlapping, but will all be different sizes. And there is a question of waking up the consumer often enough to copy out all the samples before the buffer overwrites itself. Let me think a bit. Regards, -- Alex