Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755293AbZGJNu5 (ORCPT ); Fri, 10 Jul 2009 09:50:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751181AbZGJNuu (ORCPT ); Fri, 10 Jul 2009 09:50:50 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:35908 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbZGJNuu (ORCPT ); Fri, 10 Jul 2009 09:50:50 -0400 Date: Fri, 10 Jul 2009 15:50:32 +0200 From: Ingo Molnar To: Frederic Weisbecker Cc: Peter Zijlstra , mitake@dcl.info.waseda.ac.jp, andi@firstfloor.org, acme@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat Message-ID: <20090710135032.GA26264@elte.hu> References: <20090706.142058.56800444.mitake@dcl.info.waseda.ac.jp> <1246870279.8143.4.camel@twins> <20090706115451.GA29715@one.firstfloor.org> <20090710.214547.34380852.mitake@dcl.info.waseda.ac.jp> <1247230336.7529.34.camel@twins> <20090710134307.GB23481@elte.hu> <20090710134625.GB6237@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090710134625.GB6237@nowhere> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 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: 2835 Lines: 64 * Frederic Weisbecker wrote: > On Fri, Jul 10, 2009 at 03:43:07PM +0200, Ingo Molnar wrote: > > > > * Peter Zijlstra wrote: > > > > > On Fri, 2009-07-10 at 21:45 +0900, mitake@dcl.info.waseda.ac.jp wrote: > > > > From: Andi Kleen > > > > Subject: Re: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat > > > > Date: Mon, 6 Jul 2009 13:54:51 +0200 > > > > > > > > Thank you for your replying, Peter and Andi. > > > > > > > > > > Maybe re-use the LOCK_CONTENDED macros for this, but I'm not sure we > > > > > > want to go there and put code like this on the lock hot-paths for !debug > > > > > > kernels. > > > > > > > > > > My concern was similar. > > > > > > > > > > I suspect it would be in theory ok for the slow spinning path, but I am > > > > > somewhat concerned about the additional cache miss for checking > > > > > the global flag even in this case. This could hurt when > > > > > the kernel is running fully cache hold, in that the cache miss > > > > > might be far more expensive that short spin. > > > > > > > > Yes, there will be overhead. This is certain. > > > > But there's the radical way to ignore this, > > > > adding subcategory to Kconfig for measuring spinlocks and #ifdef to spinlock.c. > > > > So people who wants to avoid this overhead can disable measurement of spinlocks completely. > > > > > > > > And there's another way to avoid the overhead of measurement. > > > > Making _spin_lock variable of function pointer. When you don't > > > > want to measure spinlocks, assign _spin_lock_raw() which is > > > > equals to current _spin_lock(). When you want to measure > > > > spinlocks, assign _spin_lock_perf() which locks and measures. > > > > This way will banish the cache miss problem you said. I think > > > > this may be useful for avoiding problem of recursion. > > > > > > We already have that, its called CONFIG_LOCKDEP && > > > CONFIG_EVENT_TRACING && CONFIG_EVENT_PROFILE, with those enabled > > > you get tracepoints on every lock acquire and lock release, and > > > perf can already use those as event sources. > > > > Yes, that could be reused for this facility too. > > > > Ingo > > > I wonder if the lock_*() events should become independant from > lockdep so that we don't need to always enable lockdep to get the > lock events at the same time. > > It could be a separate option. They already should be to a large degree if CONFIG_LOCK_STAT is enabled but CONFIG_PROVE_LOCKING is off. In theory :-) 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/