Re: [PATCH v3 2/3] writeback: drop now-unnecessary rcu_barrier() in cgroup_writeback_umount()

From: Baokun Li

Date: Wed May 20 2026 - 07:45:44 EST


On 2026/5/20 16:46, Jan Kara wrote:
> On Mon 18-05-26 21:53:48, Baokun Li wrote:
>> Commit e1b849cfa6b6 ("writeback: Avoid contention on wb->list_lock when
>> switching inodes") replaced the queue_rcu_work() based scheduling of
>> inode wb switches with a plain queue_work(). Since then no switcher
>> goes through call_rcu(), so rcu_barrier() in cgroup_writeback_umount()
>> has no callbacks of its own to wait for. It still drains unrelated
>> call_rcu() callbacks from other subsystems on busy systems, which
>> incidentally slows umount down; drop it.
>>
>> Fixes: e1b849cfa6b6 ("writeback: Avoid contention on wb->list_lock when switching inodes")
>> Signed-off-by: Baokun Li <libaokun@xxxxxxxxxxxxxxxxx>
> I've already replied to previous version but anyway: feel free to add:
>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
>
> Honza


Hi Honza,

Thank you for your review!

Sorry for the rushed v3 — your Reviewed-by on v2 came in right after
I hit send, so I missed picking it up. I'll carry it forward in v4.


Thanks,
Baokun


>> ---
>> fs/fs-writeback.c | 5 -----
>> 1 file changed, 5 deletions(-)
>>
>> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
>> index 6766de9f9d75..325a30cc35bf 100644
>> --- a/fs/fs-writeback.c
>> +++ b/fs/fs-writeback.c
>> @@ -1248,11 +1248,6 @@ void cgroup_writeback_umount(struct super_block *sb)
>> * will then drain it.
>> */
>> synchronize_rcu();
>> - /*
>> - * Use rcu_barrier() to wait for all pending callbacks to
>> - * ensure that all in-flight wb switches are in the workqueue.
>> - */
>> - rcu_barrier();
>> flush_workqueue(isw_wq);
>> }
>> }
>> --
>> 2.43.7
>>