Re: [PATCH] rcu_sync: Fix comment to properly reflect rcu_sync_exit() behavior
From: David Vernet
Date: Tue Mar 29 2022 - 20:43:05 EST
On Tue, Mar 29, 2022 at 04:22:56PM -0700, Paul E. McKenney wrote:
> As usual, I could not resist the urge to wordsmith. Please take a look
> at the following to see if I messed something up.
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit b89e06a95c05009bcf31949814c42bc420f414a6
> Author: David Vernet <void@xxxxxxxxxxxxx>
> Date: Tue Mar 29 15:26:13 2022 -0700
>
> rcu_sync: Fix comment to properly reflect rcu_sync_exit() behavior
>
> The rcu_sync_enter() function is used by updaters to force RCU readers
> (e.g. percpu-rwsem) to use their slow paths during an update. This is
> accomplished by setting the ->gp_state of the rcu_sync structure to
> GP_ENTER. In the case of percpu-rwsem, the readers' slow path waits on
> a semaphore instead of just incrementing a reader count. Each updater
> invokes the rcu_sync_exit() function to signal to readers that they
> may again take their fastpaths. The rcu_sync_exit() function sets the
> ->gp_state of the rcu_sync structure to GP_EXIT, and if all goes well,
> after a grace period the ->gp_state reverts back to GP_IDLE.
>
> Unfortunately, the rcu_sync_enter() function currently has a comment
> incorrectly stating that rcu_sync_exit() (by an updater) will re-enable
> reader "slowpaths". This patch changes the comment to state that this
> function re-enables reader fastpaths.
>
> Signed-off-by: David Vernet <void@xxxxxxxxxxxxx>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
The word smithing looks like a good improvement to me!
Thanks,
David