Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932583Ab0HDHPL (ORCPT ); Wed, 4 Aug 2010 03:15:11 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:51655 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512Ab0HDHPI (ORCPT ); Wed, 4 Aug 2010 03:15:08 -0400 Date: Wed, 4 Aug 2010 09:14:05 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: Mathieu Desnoyers , Frederic Weisbecker , Linus Torvalds , LKML , Andrew Morton , Steven Rostedt , Steven Rostedt , Thomas Gleixner , Christoph Hellwig , Li Zefan , Lai Jiangshan , Johannes Berg , Masami Hiramatsu , Arnaldo Carvalho de Melo , Tom Zanussi , KOSAKI Motohiro , Andi Kleen , "H. Peter Anvin" , Jeremy Fitzhardinge , "Frank Ch. Eigler" , Tejun Heo Subject: Re: [patch 1/2] x86_64 page fault NMI-safe Message-ID: <20100804071405.GA28183@elte.hu> References: <20100714221418.GA14533@nowhere> <20100714223107.GA2350@Krystal> <20100714224853.GC14533@nowhere> <20100714231117.GA22341@Krystal> <20100714233843.GD14533@nowhere> <20100715162631.GB30989@Krystal> <1280855904.1923.675.camel@laptop> <20100803182556.GA13798@Krystal> <1280904410.1923.700.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1280904410.1923.700.camel@laptop> User-Agent: Mutt/1.5.20 (2009-08-17) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2006 Lines: 79 * Peter Zijlstra wrote: > > What I am proposing does not even involve a copy: when we want to take a > > snapshot, we just have to force a sub-buffer switch on the ring buffer. > > The "returns" happening at the beginning of the next (empty) sub-buffer > > would clearly fail to discard records (expecting non-existing entry > > records). We would then have to save a small record saying that a function > > return occurred. The current stack frame at the end of the next sub-buffer > > could be deduced from the complete collection of stack frame samples. > > And suppose the stack-trace was all of 16 entries (not uncommon for a kernel > stack), then you waste a whole page for 128 bytes (assuming your sub-buffer > is page sized). I'll take the memcopy, thank you. To throw some hard numbers into the discussion, i found two random callgraph perf.data's on my boxes (both created prior the start of this discussion) and here is the distribution of their call-chain length: aldebaran:~> perf report -D | grep 'chain: nr:' | cut -d: -f3- | sort -n | uniq -c 2 4 21 6 23 8 13 9 20 10 29 11 21 12 25 13 54 14 112 15 72 16 77 17 35 18 38 19 48 20 29 21 10 22 97 23 3 24 1 25 2 26 2 28 2 29 1 30 2 31 So the peak/average here is around 15 entries. The other one: phoenix:~> perf report -D | grep 'chain: nr:' | cut -d: -f3- | sort -n | uniq -c 1 2 70 3 222 4 112 5 116 6 329 7 241 8 163 9 203 10 287 11 159 12 4 13 6 14 22 15 2 16 11 17 5 18 Here the average is even lower - around 8 entries. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/