Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

From: David Woodhouse
Date: Mon Jul 09 2018 - 16:35:47 EST




On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote:
>
> So here are the possible code paths when .rcu_urgent_qs is set to true:
>
> 1.ÂÂÂÂÂÂA context switch will record the quiescent state and clear
> ÂÂÂÂÂÂÂÂ.rcu_urgent_qs. (The failure to do the clearing in current -rcu
> ÂÂÂÂÂÂÂÂfor PREEMPT builds is a performance bug that I need to fix.)

What if there's nothing else runnable and there is no actual context
switch?

> 2.ÂÂÂÂÂÂA cond_resched() will cause rcu_all_qs() to be invoked, which
> ÂÂÂÂÂÂÂÂwill record a quiescent state and clear .rcu_urgent_qs.
>
> 3.ÂÂÂÂÂÂWith the patch below, a scheduling-clock interrupt of a
> ÂÂÂÂÂÂÂÂnon-idle non-userspace task will force a reschedule, which
> ÂÂÂÂÂÂÂÂwill result in #1 above happening.

Attachment: smime.p7s
Description: S/MIME cryptographic signature