mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	nhorman@tuxdriver.com, linux-kernel@vger.kernel.org
Subject: Re: [2.6.32-rc5-git5] synchronize_sched() inside spin_lock()?
Date: Mon, 2 Nov 2009 16:55:22 -0800	[thread overview]
Message-ID: <20091103005522.GD6795@linux.vnet.ibm.com> (raw)
In-Reply-To: <200911021533.46413.dmitry.torokhov@gmail.com>

On Mon, Nov 02, 2009 at 03:33:46PM -0800, Dmitry Torokhov wrote:
> On Monday 02 November 2009 02:30:28 pm Paul E. McKenney wrote:
> > On Mon, Nov 02, 2009 at 09:00:06PM +0900, Tetsuo Handa wrote:
> > > Commit: 4ea7e38696c7e798c47ebbecadfd392f23f814f9
> > >
> > > tracepoint_synchronize_unregister() calls synchronize_sched(), but it is
> > > between spin_lock() and spin_unlock(). Is it OK?
> > 
> > Calling synchronize_sched() while holding a spinlock would indeed be
> > very bad, but the code below seems to instead be invoking call_rcu(),
> > which is no problem.
> > 
> > Or am I missing something here?
> > 
> > 							Thanx, Paul
> > 
> > > static int set_all_monitor_traces(int state)
> > > {
> > > 	int rc = 0;
> > > 	struct dm_hw_stat_delta *new_stat = NULL;
> > > 	struct dm_hw_stat_delta *temp;
> > >
> > > 	spin_lock(&trace_state_lock);
> > >
> > > 	switch (state) {
> > > 	case TRACE_ON:
> > > 		rc |= register_trace_kfree_skb(trace_kfree_skb_hit);
> > > 		rc |= register_trace_napi_poll(trace_napi_poll_hit);
> > > 		break;
> > > 	case TRACE_OFF:
> > > 		rc |= unregister_trace_kfree_skb(trace_kfree_skb_hit);
> > > 		rc |= unregister_trace_napi_poll(trace_napi_poll_hit);
> > >
> > > 		tracepoint_synchronize_unregister();
> 
> This has synchronize_sched() inside.

Ah!  That would indeed be bad.

							Thanx, Paul

  reply	other threads:[~2009-11-03  0:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 12:00 Tetsuo Handa
2009-11-02 22:30 ` Paul E. McKenney
2009-11-02 23:33   ` Dmitry Torokhov
2009-11-03  0:55     ` Paul E. McKenney [this message]
2009-11-22 13:49 ` [2.6.32-rc8] set_all_monitor_traces() sleeping bug Tetsuo Handa

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=20091103005522.GD6795@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=penguin-kernel@i-love.sakura.ne.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

all inboxes | Powered by JetHome®