From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
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 10:05:05 -0700 [thread overview]
Message-ID: <20100621170505.GE2354@linux.vnet.ibm.com> (raw)
In-Reply-To: <1277139011.1875.522.camel@laptop>
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(). One reason for doing this would be to put more stress
on preemptible RCU's handling of context switches in RCU read-side
critical sections.
Another approach would be to have some high-priority threads that wake up
periodically, as I plan to make rcutorture do for RCU priority boosting.
Of course, this is not necessarily mutually exclusive with Lai's approach.
Thanx, Paul
next prev parent reply other threads:[~2010-06-21 17:05 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 [this message]
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=20100621170505.GE2354@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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