lkml.org 
[lkml]   [2015]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH RFC tip/core/rcu 2/5] rcu: Short-circuit normal GPs via expedited GPs
    On Wed, Jul 01, 2015 at 07:03:13AM -0700, Paul E. McKenney wrote:
    > On Wed, Jul 01, 2015 at 03:48:06PM +0200, Peter Zijlstra wrote:
    > > On Wed, Jul 01, 2015 at 06:41:44AM -0700, Paul E. McKenney wrote:
    > > > On Wed, Jul 01, 2015 at 12:05:21PM +0200, Peter Zijlstra wrote:
    > > > > On Tue, Jun 30, 2015 at 02:48:27PM -0700, Paul E. McKenney wrote:
    > > > > > rsp->gp_state = RCU_GP_WAIT_FQS;
    > > > > > ret = wait_event_interruptible_timeout(rsp->gp_wq,
    > > > > > + ((gf = READ_ONCE(rsp->gp_flags)) &
    > > > > > + RCU_GP_FLAG_FQS) ||
    > > > > > + (!READ_ONCE(rnp->qsmask) &&
    > > > > > + !rcu_preempt_blocked_readers_cgp(rnp)) ||
    > > > > > + rcu_exp_gp_seq_done(rsp->exp_rsp,
    > > > > > + rsp->gp_exp_snap),
    > > > > > + j);
    > > > > > rsp->gp_state = RCU_GP_DONE_FQS;
    > > > >
    > > > > How can the GP be done if we timed out or got interrupted?
    > > >
    > > > If all the CPUs still blocking the grace period went idle, or in a
    > > > NO_HZ_FULL kernel, entered nohz_full userspace execution. Or, if
    > > > certain low-probability races happen, went offline.
    > >
    > > But what if none of those are true and we still timed out? You
    > > unconditionally grant the GP.
    >
    > Say what???
    >
    > I recheck the conditions and break out of the loop only if one or more
    > of the grace-period-end conditions is satisfied. If not, I invoke
    > rcu_gp_fqs() to do the scan to see if all remaining CPUs are idle,
    > in nohz_full userspace execution, or offline.
    >
    > What am I mising here?

    The whole wait_event_interruptible_timeout() thing can end without @cond
    being true, after which you unconditionally set ->gp_state =
    RCU_GP_DONE_FQS.


    \
     
     \ /
      Last update: 2015-07-02 14:21    [W:5.565 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site