Re: [PATCH 22/32] rcu: Restart tick if we enqueue a callback in anohz/cpuset CPU

From: Frederic Weisbecker
Date: Tue Aug 16 2011 - 22:18:36 EST


On Tue, Aug 16, 2011 at 01:20:05PM -0700, Paul E. McKenney wrote:
> > @@ -1546,6 +1547,13 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
> > rdp->nxttail[RCU_NEXT_TAIL] = &head->next;
> > rdp->qlen++;
> >
> > + /* Restart the timer if needed to handle the callbacks */
> > + if (tick_nohz_adaptive_mode()) {
> > + /* Make updates on nxtlist visible to self IPI */
> > + barrier();
> > + smp_cpuset_update_nohz(smp_processor_id());
> > + }
> > +
>
> But this must be happening in a system call or interrupt handler, right?
> If so, won't we get a chance to check things on exit from the system call
> or interrupt? Or are you hooking only into syscall entry?

Sure in theory when we call call_rcu() we are in the kernel and thus not
very far from a syscall/exception/irq exit into userspace or a scheduling
out.

We could rely on that assumption and I bet it won't ever be a problem
in practice. I just wanted to ensure we don't spend too much time
before handling that callback.

> > /* If interrupts were disabled, don't dive into RCU core. */
> > if (irqs_disabled_flags(flags)) {
> > local_irq_restore(flags);
> > --
> > 1.7.5.4
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/