Re: question about RCU dynticks_nesting

From: Paul E. McKenney
Date: Tue May 05 2015 - 08:30:53 EST


On Tue, May 05, 2015 at 12:51:02PM +0200, Peter Zijlstra wrote:
> On Tue, May 05, 2015 at 12:48:34PM +0200, Peter Zijlstra wrote:
> > On Mon, May 04, 2015 at 03:00:44PM -0400, Rik van Riel wrote:
> > In case of the non-preemptible RCU, we could easily also
> > > increase current->rcu_read_lock_nesting at the same time
> > > we increase the preempt counter, and use that as the
> > > indicator to test whether the cpu is in an extended
> > > rcu quiescent state. That way there would be no extra
> > > overhead at syscall entry or exit at all. The trick
> > > would be getting the preempt count and the rcu read
> > > lock nesting count in the same cache line for each task.
> >
> > Can't do that. Remember, on x86 we have per-cpu preempt count, and your
> > rcu_read_lock_nesting is per task.
>
> Hmm, I suppose you could do the rcu_read_lock_nesting thing in a per-cpu
> counter too and transfer that into the task_struct on context switch.
>
> If you manage to put both sides of that in the same cache things should
> not add significant overhead.
>
> You'd have to move the rcu_read_lock_nesting into the thread_info, which
> would be painful as you'd have to go touch all archs etc..

Last I tried doing that, things got really messy at context-switch time.
Perhaps I simply didn't do the save/restore in the right place?

Thanx, Paul

--
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/