From: Don Zickus <dzickus@redhat.com>
To: Russ Anderson <rja@sgi.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
rja@americas.sgi.com
Subject: Re: [PATCH] x86: Avoid intermixing cpu dump_stack output on multi-processor systems
Date: Mon, 4 Jun 2012 10:23:53 -0400 [thread overview]
Message-ID: <20120604142353.GI32472@redhat.com> (raw)
In-Reply-To: <20120601225603.GD24318@sgi.com>
On Fri, Jun 01, 2012 at 05:56:03PM -0500, Russ Anderson wrote:
> > I am curious, your NMI handler has locking wrapped around dump_stack,
> > shouldn't that serialize the output the way you want it? Why isn't that
> > working?
>
> Yes, you're right, it does. It is working. I'd forgotten that
> the community kernel has uv_nmi_lock in uv_handle_nmi. Must
> be working too much with distro kernels. :-) But that doesn't
> help for all the other code paths than call dump_stack.
Sure, I agree. But not every caller of dump_stack needs to dump for all
cpus. I was just trying to avoid the ugly complicated code of
cmp_xchange you were requesting.
>
>
> > > FWIW, "Wait for up to 10 seconds for all CPUs to do the backtrace" on
> > > a 4096 cpu system isn't long enough. :-)
> >
> > Good point. :-)
> >
> > >
> > > > Whereas the lock you are proposing can be called in a mixture of NMI and
> > > > IRQ which could cause deadlocks I believe.
> > >
> > > Since this is a lock just around the dump_stack printk, would
> > > checking for forward progress and a timeout to catch any possible
> > > deadlock be sufficient? In the unlikely case of a deadlock the
> > > lock gets broken and some of the cpu backtraces get intermixed.
> > > That is still a huge improvement over the current case where
> > > all of the backtraces get intermixed.
> >
> > I saw your new patch based on Frederick's input. It seems to take care of
> > deadlock situations though you run into the starving lock problem that
> > ticketed spinlocks solved. Which is why I am curious why moving the
> > locking one layer up to the NMI handler (which is where it is currently),
> > didn't fix your problem.
>
> Locking in dump_stack would remove the need for uv_nmi_lock.
I agree. I was just wondering if the added complexities were worth it for
the normal case.
If the uv_nmi_lock works, then I feel comfortable that your second patch
based on Frederic's suggestion will work too. I just feel uncomfortable
with locking on a stack dump that should be reliable. It is one thing to
do the locking in only NMI space or only IRQ space, but now we are
traversing both. I don't think there will be any deadlocks (based on the
else path).
It could just be an overhyped paranoia of mine. But that was my biggest
hestitation.
Cheers,
Don
prev parent reply other threads:[~2012-06-04 14:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 14:42 [PATCH] x86: Avoid intermixing cpu dump_stack output on multi-processor systems Russ Anderson
2012-05-24 15:34 ` Frederic Weisbecker
2012-05-29 18:50 ` Russ Anderson
2012-05-29 17:53 ` Don Zickus
2012-05-29 19:19 ` Russ Anderson
2012-05-29 22:39 ` Don Zickus
2012-05-29 23:11 ` Russ Anderson
2012-05-29 23:54 ` Don Zickus
2012-06-01 22:56 ` Russ Anderson
2012-06-04 14:23 ` Don Zickus [this message]
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=20120604142353.GI32472@redhat.com \
--to=dzickus@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rja@americas.sgi.com \
--cc=rja@sgi.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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