[Devel] [PATCH VZ10] fs/fuse: cleanup and workqueue improvements

Liu Kui kui.liu at virtuozzo.com
Mon May 18 13:49:23 MSK 2026


Remove the subtraction of FUSE_ROOT_ID from fi->inode in trace messages
to maintain consistency with the rest of the kernel.

Use WQ_UNBOUND for the fuse_inval_files_wq workqueue, as the work items
have no affinity requrement to a specific CPU. This allows any available
CPU to run the work, improving scheduling flexibility.

Fixes: 5a19728412f4 ("fs/fuse: revamp fuse_invalidate_files() to avoid
blocking the userspace evloop")

Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
---
 fs/fuse/inode.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index d627302da0b4..1e0c86f4b37a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -620,12 +620,10 @@ static void fuse_inval_files_work(struct work_struct *w)
 	spin_unlock(&fc->lock);
 
 	while (!list_empty(&inval_files_list)) {
-		u64 nodeid;
 
 		fi = list_first_entry(&inval_files_list, struct fuse_inode, inval_files_entry);
 		list_del(&fi->inval_files_entry);
-		nodeid = get_node_id(&fi->inode) - FUSE_ROOT_ID;
-		fuse_ktrace(fc, "invalidate_file on [%llu] starts", nodeid);
+		fuse_ktrace(fc, "invalidate_file on [%llu] starts", fi->nodeid);
 
 		spin_lock(&fi->lock);
 		list_for_each_entry(ff, &fi->rw_files, rw_entry)
@@ -642,7 +640,7 @@ static void fuse_inval_files_work(struct work_struct *w)
 		wake_up_bit(&fi->state, FUSE_I_INVAL_FILES);
 		spin_unlock(&fi->lock);
 
-		fuse_ktrace(fc, "invalidate_file on [%llu] ends", nodeid);
+		fuse_ktrace(fc, "invalidate_file on [%llu] ends", fi->nodeid);
 		iput(&fi->inode);
 	}
 
@@ -2501,7 +2499,8 @@ static int __init fuse_fs_init(void)
 {
 	int err = -ENOMEM;
 
-	fuse_inval_files_wq = alloc_workqueue("fuse_inval_files_wq", WQ_MEM_RECLAIM, 1);
+	fuse_inval_files_wq = alloc_workqueue("fuse_inval_files_wq",
+					WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
 	if (!fuse_inval_files_wq)
 		goto out;
 
-- 
2.39.5 (Apple Git-154)



More information about the Devel mailing list