public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@linux.vnet.ibm.com
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rcutorture: add random preemption
Date: Mon, 21 Jun 2010 18:50:11 +0200	[thread overview]
Message-ID: <1277139011.1875.522.camel@laptop> (raw)
In-Reply-To: <20100621164306.GC2354@linux.vnet.ibm.com>

On Mon, 2010-06-21 at 09:43 -0700, Paul E. McKenney wrote:
> > +#ifdef CONFIG_PREEMPT
> > +     if (!preempt_count() && !(rcu_random(rrsp) % (nrealreaders * 20000)))
> > +             preempt_schedule();
> > +#endif
> 
> This one scared me for a bit -- then I realized that preempt_schedule()
> won't actually schedule if preemption is in any way disabled.  So the
> above really is OK, because Classic RCU and RCU-bh disable preemption.
> 
> So, should we have a comment to this effect, or is my hypersensitivity to
> RCU semantics unique to me? 

Well it seems to do a !preempt_count() test too, so I wouldn't worry too
much about it, still using preempt_schedule() doesn't seem right, why
not use cond_resched()?

  reply	other threads:[~2010-06-21 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21  8:57 [PATCH] rcutorture: add random preemption Lai Jiangshan
2010-06-21 16:43 ` Paul E. McKenney
2010-06-21 16:50   ` Peter Zijlstra [this message]
2010-06-21 17:05     ` Paul E. McKenney
2010-06-21 17:06       ` Peter Zijlstra

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=1277139011.1875.522.camel@laptop \
    --to=peterz@infradead.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.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