From: Don Zickus <dzickus@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: ZAK Magnus <zakmagnus@google.com>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Mandeep Singh Baines <msb@chromium.org>
Subject: Re: [PATCH v4 2/2] Output stall traces in /proc
Date: Mon, 8 Aug 2011 17:37:21 -0400 [thread overview]
Message-ID: <20110808213721.GA1972@redhat.com> (raw)
In-Reply-To: <1312836771.22367.35.camel@twins>
On Mon, Aug 08, 2011 at 10:52:51PM +0200, Peter Zijlstra wrote:
> Since its the NMI context that's generating the data, disabling IRQs
> will obviously not do much good.
>
> Also, if you've got a procfs output, what do you need irq_work for?
>
> Depending on the type of data and kind of data loss you can incur, would
> a static per-cpu buffer be ok? You can guard it by a single bit, if
> cleared NMI can write, if set NMI will skip over and loose the data.
>
> Then your procfs routine can set the bit, dump out the latest version of
> the data and clear the bit again. If you always want the NMI thing to be
> able to write, use two buffers, if you 'lock' then one at a time,
> there's always one writable.
>
> All you need is atomic bitops :-)
>
> > > > The softstall case should be ok though.
> > > Why's that? The soft stall traces are not written in a NMI context but
> > > just in a regular interrupt context, right? Doesn't that pose similar
> > > problems?
>
> You should be able to do stack traces from NMI context, that's what perf
> does after all.
>
> > > These are weird rare corner cases anyway, right? Maybe the simplest
> > > thing could be to let the interrupts only try_lock(), so they might
> > > sometimes fail to record a stall, but it would be a pretty big
> > > coincidence.
>
> Sure you can do a trylock. I'm still not quite sure what you want the
> irq_work for.. there's no guarantee the interrupt runs immediately after
> the NMI, it could be the NMI is in the middle of a irq disabled region,
> or the whole thing is ran on an architecture without
> arch_irq_work_raise().
Maybe irq_work isn't what we needed. I just wasn't smart enough to figure
out how to make sure we can write data in an NMI context and read it in a
normal context. I supposed the whole swapping buffers could work and is
simpler.
Basically, Zak was working on a way to save stack traces of potential
hard/soft lockups (ones that lockup for a minimum amount of time but
un-lockup before actually triggering anything). The idea was to get
visibility of who is spending time doing some wrong before it is too late.
Cheers,
Don
next prev parent reply other threads:[~2011-08-08 21:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 22:13 [PATCH v4 1/2] Track hard and soft "short lockups" or "stalls." Alex Neronskiy
2011-08-04 22:13 ` [PATCH v4 2/2] Output stall traces in /proc Alex Neronskiy
2011-08-05 13:40 ` Don Zickus
2011-08-05 17:12 ` Alex Neronskiy
2011-08-05 18:43 ` Don Zickus
2011-08-05 21:26 ` ZAK Magnus
2011-08-08 20:19 ` Don Zickus
2011-08-08 20:52 ` Peter Zijlstra
2011-08-08 21:37 ` Don Zickus [this message]
2011-08-08 23:34 ` Alex Neronskiy
2011-08-09 21:08 ` Don Zickus
2011-08-09 21:44 ` Alex Neronskiy
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=20110808213721.GA1972@redhat.com \
--to=dzickus@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=msb@chromium.org \
--cc=peterz@infradead.org \
--cc=zakmagnus@google.com \
/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