Re: [PATCH 1/1] rcu: Introduce CONFIG_RCU_EXP_CPU_STALL_TIMEOUT

From: Uladzislau Rezki
Date: Thu Feb 17 2022 - 12:52:39 EST


On Wed, Feb 16, 2022 at 11:55:08AM -0800, Paul E. McKenney wrote:
> On Wed, Feb 16, 2022 at 02:52:09PM +0100, Uladzislau Rezki (Sony) wrote:
> > From: Uladzislau Rezki <uladzislau.rezki@xxxxxxxx>
> >
> > Currently for both expedited and regular grace periods stall
> > warnings are emitted based on one timeout value that is defined
> > in seconds. The problem is that, a stall timeout in seconds for
> > expedited grace period is a way long.
> >
> > The idea of expedited grace period is to force CPUs to report
> > their quiescent states as fast as possible. If in RCU read-side
> > critical section, it will request the next rcu_read_unlock() to
> > record the quiescent state. If not either it reports immediately
> > or set TIF_NEED_RESCHED to initiate the task switch.
> >
> > Therefore introduce the CONFIG_RCU_EXP_CPU_STALL_TIMEOUT kernel
> > configuration that is set to 20 msec. It also can be changed in
> > run-time via: /sys/.../parameters/rcu_exp_cpu_stall_timeout.
> >
> > Signed-off-by: Uladzislau Rezki <uladzislau.rezki@xxxxxxxx>
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
>
> Nice, thank you!
>
> I have queued this, with the usual wordsmithing.
>
> I also changed the CONFIG_RCU_EXP_CPU_STALL_TIMEOUT kconfig option's
> default to be 20 milliseconds only no CONFIG_ANDROID=y kernel builds. For
> one, rcutorture gets expedited stall warnings even at 200 milliseconds,
> and for another, larger systems often have longer-running readers.
> It might be a very good thing to decrease the non-Android default
> expedited stall warning timeout, but 20 milliseconds is not likely the
> place to start that effort. Though it would be one way to find out
> when in the process large-system users started testing. ;-)
>
> My guess is that this change will result in some breakage even on Android,
> and that adjustments will be needed. Once that effort is complete,
> it would probably make sense to take another look at the non-Android
> default for CONFIG_RCU_EXP_CPU_STALL_TIMEOUT.
>
Yep, totally agree. There will be needed an addition adjustment later on to
find some better floor value :)

--
Vlad Rezki