Move dmap free worker kicker inside the critical region, so that extra spinlock lock/unlock could be avoided. Suggested-by: Liu Jiang <gerry at linux.alibaba.com> Signed-off-by: Jeffle Xu <jefflexu at linux.alibaba.com> --- fs/fuse/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index d7d3a7f06862..b9f8795d52c4 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -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; } -- 2.27.0
On Sat, Apr 02, 2022 at 06:32:50PM +0800, Jeffle Xu wrote:> Move dmap free worker kicker inside the critical region, so that extra > spinlock lock/unlock could be avoided. > > Suggested-by: Liu Jiang <gerry at linux.alibaba.com> > Signed-off-by: Jeffle Xu <jefflexu at linux.alibaba.com> > --- > fs/fuse/dax.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20220404/97314305/attachment.sig>
On Sat, Apr 02, 2022 at 06:32:50PM +0800, Jeffle Xu wrote:> Move dmap free worker kicker inside the critical region, so that extra > spinlock lock/unlock could be avoided. > > Suggested-by: Liu Jiang <gerry at linux.alibaba.com> > Signed-off-by: Jeffle Xu <jefflexu at linux.alibaba.com>Looks good to me. Have you done any testing to make sure nothing is broken. Reviewed-by: Vivek Goyal <vgoyal at redhat.com> Vivek> --- > fs/fuse/dax.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c > index d7d3a7f06862..b9f8795d52c4 100644 > --- a/fs/fuse/dax.c > +++ b/fs/fuse/dax.c > @@ -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; > } > > -- > 2.27.0 >