lkml.org 
[lkml]   [2012]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH tip/core/rcu 06/23] rcu: Break up rcu_gp_kthread() into subfunctions
    From
    Date
    On Thu, 2012-08-30 at 11:18 -0700, Paul E. McKenney wrote:
    > +static int rcu_gp_kthread(void *arg)
    > +{
    > + struct rcu_state *rsp = arg;
    > + struct rcu_node *rnp = rcu_get_root(rsp);
    > +
    > + for (;;) {
    > +
    > + /* Handle grace-period start. */
    > + for (;;) {
    > + wait_event_interruptible(rsp->gp_wq, rsp->gp_flags);
    > + if (rsp->gp_flags && rcu_gp_init(rsp))
    > + break;
    > + cond_resched();
    > + flush_signals(current);
    > + }
    >
    > /* Handle grace-period end. */
    > for (;;) {
    > wait_event_interruptible(rsp->gp_wq,
    > !ACCESS_ONCE(rnp->qsmask) &&
    > !rcu_preempt_blocked_readers_cgp(rnp));
    > if (!ACCESS_ONCE(rnp->qsmask) &&
    > + !rcu_preempt_blocked_readers_cgp(rnp) &&
    > + rcu_gp_cleanup(rsp))
    > break;
    > + cond_resched();
    > flush_signals(current);
    > }
    > }
    > return 0;
    > }

    Should there not be a kthread_stop() / kthread_park() call somewhere in
    there?

    Also, it could be me, but all those nested for (;;) loops make the flow
    rather non-obvious.


    \
     
     \ /
      Last update: 2012-09-06 16:23    [W:4.098 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site