From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
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
Date: Fri, 10 Jul 2009 15:50:32 +0200 [thread overview]
Message-ID: <20090710135032.GA26264@elte.hu> (raw)
In-Reply-To: <20090710134625.GB6237@nowhere>
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> On Fri, Jul 10, 2009 at 03:43:07PM +0200, Ingo Molnar wrote:
> >
> > * Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> >
> > > On Fri, 2009-07-10 at 21:45 +0900, mitake@dcl.info.waseda.ac.jp wrote:
> > > > From: Andi Kleen <andi@firstfloor.org>
> > > > 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
next prev parent reply other threads:[~2009-07-10 13:50 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 6:21 [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat Hitoshi Mitake
2009-07-01 7:31 ` Ingo Molnar
2009-07-01 8:21 ` Hitoshi Mitake
2009-07-01 13:45 ` Frederic Weisbecker
2009-07-01 13:50 ` Ingo Molnar
2009-07-01 14:17 ` mitake
2009-07-01 7:38 ` Andi Kleen
2009-07-01 8:42 ` Hitoshi Mitake
2009-07-01 9:07 ` Ingo Molnar
2009-07-01 9:42 ` Hitoshi Mitake
2009-07-01 11:06 ` Ingo Molnar
2009-07-01 12:53 ` Hitoshi Mitake
2009-07-01 15:44 ` Frederic Weisbecker
2009-07-06 5:20 ` mitake
2009-07-06 8:51 ` Peter Zijlstra
2009-07-06 11:54 ` Andi Kleen
2009-07-10 12:45 ` mitake
2009-07-10 12:52 ` Peter Zijlstra
2009-07-10 13:43 ` Ingo Molnar
2009-07-10 13:46 ` Frederic Weisbecker
2009-07-10 13:50 ` Ingo Molnar [this message]
2009-07-10 13:56 ` Peter Zijlstra
2009-07-12 7:23 ` Hitoshi Mitake
2009-07-12 13:24 ` Peter Zijlstra
2009-07-13 6:06 ` Hitoshi Mitake
2009-07-13 8:51 ` Ingo Molnar
2009-07-14 0:48 ` Hitoshi Mitake
2009-07-18 13:25 ` Ingo Molnar
2009-07-01 12:40 ` Andi Kleen
2009-07-01 13:50 ` [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat II Andi Kleen
2009-07-01 9:48 ` [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090710135032.GA26264@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mitake@dcl.info.waseda.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox