All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/2] x86: Make the x86-64 stacktrace code safely callable from scheduler
Date: Fri, 13 May 2011 15:29:19 +0200	[thread overview]
Message-ID: <20110513132916.GB1840@nowhere> (raw)
In-Reply-To: <1305292798.2466.29.camel@twins>

On Fri, May 13, 2011 at 03:19:58PM +0200, Peter Zijlstra wrote:
> On Fri, 2011-05-13 at 14:48 +0200, Frederic Weisbecker wrote:
> > I haven't observed any deadlock. trace events disable preemption and
> > other tracers do too (my changelog was buggy).
> > 
> > I just worried about potential other users, like a WARN_ON in the
> > scheduler or so.
> > 
> > My worry is the following scenario:
> > 
> > schedule() {
> >         acquire(rq)
> >                                                         set_tsk_need_resched
> >         WARN_ON() {
> >                 stack_trace() {
> >                         preempt_enable() {
> >                                 preempt_schedule() {
> 
> Would never happen, because rq->lock is a spinlock which holds another
> preempt count so preempt_enable() would never schedule.

Oh right.

> 
> >                                         acquire(rq)
> >                                 }
> >                         }
> >                 }
> >         }
> > }
> 
> 
> 
> > I don't know if it happens that one set TIF_NEED_RESCHED remotely,
> 
> Yes
> 
> > or if TIF_NEED_RESCHED can be set when we hold the rq,
> 
> Yes
> 
> >  and then we
> > can be followed by a WARN_ON, ...
> 
> Not quite sure, but possible.
> 
> > So I preferred to be careful. 
> 
> Still not quite seeing how all things could go bang.

Nah, forget about that, I was just confused ;)

      reply	other threads:[~2011-05-13 13:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 20:32 [GIT PULL] x86 stacktrace updates Frederic Weisbecker
2011-05-12 20:32 ` [PATCH 1/2] x86: Remove warning and warning_symbol from struct stacktrace_ops Frederic Weisbecker
2011-07-14 11:01   ` Mel Gorman
2011-07-14 13:50     ` Frederic Weisbecker
2011-05-12 20:32 ` [PATCH 2/2] x86: Make the x86-64 stacktrace code safely callable from scheduler Frederic Weisbecker
2011-05-12 20:40   ` Frederic Weisbecker
2011-05-12 21:28   ` Ingo Molnar
2011-05-12 21:43     ` Frederic Weisbecker
2011-05-12 21:55       ` Ingo Molnar
2011-05-13 10:48   ` Steven Rostedt
2011-05-13 12:48     ` Frederic Weisbecker
2011-05-13 13:19       ` Peter Zijlstra
2011-05-13 13:29         ` Frederic Weisbecker [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=20110513132916.GB1840@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.