]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
writeback: drop now-unnecessary rcu_barrier() in cgroup_writeback_umount()
authorBaokun Li <libaokun@linux.alibaba.com>
Thu, 21 May 2026 09:50:15 +0000 (17:50 +0800)
committerChristian Brauner <brauner@kernel.org>
Fri, 22 May 2026 10:06:35 +0000 (12:06 +0200)
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")
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>
Link: https://patch.msgid.link/20260521095016.2791354-3-libaokun@linux.alibaba.com
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/fs-writeback.c

index 6766de9f9d75b34d3e0040f13d9698cd33cad929..325a30cc35bfb85b3bc03bf9164f3da3a4727489 100644 (file)
@@ -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);
        }
 }