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 19:06:57 +0200 [thread overview]
Message-ID: <1277140017.1875.523.camel@laptop> (raw)
In-Reply-To: <20100621170505.GE2354@linux.vnet.ibm.com>
On Mon, 2010-06-21 at 10:05 -0700, Paul E. McKenney wrote:
> On Mon, Jun 21, 2010 at 06:50:11PM +0200, Peter Zijlstra wrote:
> > 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()?
>
> My guess is that Lai wants to force a call to rcu_sched_qs() even if
> !need_resched().
Ah, d'0h yeah, I'm not having the best of days.. monday or something :-)
prev parent reply other threads:[~2010-06-21 17:07 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
2010-06-21 17:05 ` Paul E. McKenney
2010-06-21 17:06 ` Peter Zijlstra [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=1277140017.1875.523.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