lkml.org 
[lkml]   [2010]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] rcutorture: add random preemption
    From
    Date
    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 :-)


    \
     
     \ /
      Last update: 2010-06-21 19:09    [W:0.021 / U:30.212 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site