Re: [PATCH v3 tip/core/rcu 40/40] rcu: Make non-preemptive schedule be Tasks RCU quiescent state

From: Levin, Alexander (Sasha Levin)
Date: Thu Sep 28 2017 - 11:39:36 EST


On Thu, Sep 28, 2017 at 05:30:55AM -0700, Paul E. McKenney wrote:
>On Thu, Sep 28, 2017 at 02:37:20AM -0700, Sasha Levin wrote:
>> On Wed, Apr 19, 2017 at 9:58 AM, Paul E. McKenney
>> <paulmck@xxxxxxxxxxxxxxxxxx> wrote:
>> > Currently, a call to schedule() acts as a Tasks RCU quiescent state
>> > only if a context switch actually takes place. However, just the
>> > call to schedule() guarantees that the calling task has moved off of
>> > whatever tracing trampoline that it might have been one previously.
>> > This commit therefore plumbs schedule()'s "preempt" parameter into
>> > rcu_note_context_switch(), which then records the Tasks RCU quiescent
>> > state, but only if this call to schedule() was -not- due to a preemption.
>> >
>> > To avoid adding overhead to the common-case context-switch path,
>> > this commit hides the rcu_note_context_switch() check under an existing
>> > non-common-case check.
>> >
>> > Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
>> > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
>>
>> Hey Paul,
>>
>> I'm seeing the following on the latest -next kernel, and suspect it's
>> caused bit this patch:
>
>Hmmm... kernel/rcu/tree_plugin.h:329 thinks that someone slept (as opposed
>to was preempted) in an RCU read-side critical section.
>
>If this is reproducible, could you please enable lockdep if you are not
>already doing so?

lockdep was on, as far as I can tell.

It happened once in ~3 weeks of fuzzing, so not sure how easily I can reproduce.

--

Thanks,
Sasha