virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jeffle Xu <jefflexu@linux.alibaba.com>
To: miklos@szeredi.hu, vgoyal@redhat.com, stefanha@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org
Cc: gerry@linux.alibaba.com
Subject: [PATCH] fuse: avoid unnecessary spinlock bump
Date: Sat,  2 Apr 2022 18:32:50 +0800	[thread overview]
Message-ID: <20220402103250.68027-1-jefflexu@linux.alibaba.com> (raw)

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>
---
 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

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

             reply	other threads:[~2022-04-02 10:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02 10:32 Jeffle Xu [this message]
2022-04-04  8:49 ` [PATCH] fuse: avoid unnecessary spinlock bump Stefan Hajnoczi
2022-04-07 14:10 ` Vivek Goyal
2022-04-08  2:36   ` JeffleXu
2022-04-08 11:25     ` Vivek Goyal
2022-04-08 11:50       ` JeffleXu
2022-04-08 12:06         ` Vivek Goyal
2022-04-11  2:10           ` JeffleXu
2022-04-11 11:52             ` Vivek Goyal
2022-04-11 11:54               ` JeffleXu
     [not found]                 ` <afc2f1ec-8aff-35fa-5fde-75852db7b4a8@fastmail.fm>
2022-04-11 14:00                   ` Vivek Goyal
2022-04-13  3:09                     ` JeffleXu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220402103250.68027-1-jefflexu@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=gerry@linux.alibaba.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=stefanha@redhat.com \
    --cc=vgoyal@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).