]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
virtio_fs: Remove redundant spinlock in virtio_fs_request_complete()
authorLi RongQing <lirongqing@baidu.com>
Sun, 15 Jun 2025 13:20:39 +0000 (21:20 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 27 Aug 2025 12:29:43 +0000 (14:29 +0200)
Since clear_bit is an atomic operation, the spinlock is redundant and
can be removed, reducing lock contention is good for performance.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/virtio_fs.c

index c826e7ca49f5802bce52b7d288d9179f4631b25e..aeb488750fa6be39bbed63c12a85446e96562e66 100644 (file)
@@ -761,7 +761,6 @@ static void copy_args_from_argbuf(struct fuse_args *args, struct fuse_req *req)
 static void virtio_fs_request_complete(struct fuse_req *req,
                                       struct virtio_fs_vq *fsvq)
 {
-       struct fuse_pqueue *fpq = &fsvq->fud->pq;
        struct fuse_args *args;
        struct fuse_args_pages *ap;
        unsigned int len, i, thislen;
@@ -790,9 +789,7 @@ static void virtio_fs_request_complete(struct fuse_req *req,
                }
        }
 
-       spin_lock(&fpq->lock);
        clear_bit(FR_SENT, &req->flags);
-       spin_unlock(&fpq->lock);
 
        fuse_request_end(req);
        spin_lock(&fsvq->lock);