]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fuse: avoid unnecessary spinlock bump
authorJeffle Xu <jefflexu@linux.alibaba.com>
Sat, 2 Apr 2022 10:32:50 +0000 (18:32 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 21 Jul 2022 14:02:45 +0000 (16:02 +0200)
Move dmap free worker kicker inside the critical region, so that extra
spinlock lock/unlock could be avoided.

Suggested-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dax.c

index 10eb50cbf398c4b0e58ac3fe7e8d110e77f31036..e23e802a80130af9d007e36e47b446105a65c410 100644 (file)
@@ -138,9 +138,9 @@ static struct fuse_dax_mapping *alloc_dax_mapping(struct fuse_conn_dax *fcd)
                WARN_ON(fcd->nr_free_ranges <= 0);
                fcd->nr_free_ranges--;
        }
+       __kick_dmap_free_worker(fcd, 0);
        spin_unlock(&fcd->lock);
 
-       kick_dmap_free_worker(fcd, 0);
        return dmap;
 }