From: lirongqing <lirongqing@baidu.com>
To: <vgoyal@redhat.com>, <stefanha@redhat.com>, <miklos@szeredi.hu>,
<eperezma@redhat.com>, <virtualization@lists.linux.dev>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Li RongQing <lirongqing@baidu.com>
Subject: [PATCH] virtio_fs: Remove request addition to processing list
Date: Fri, 20 Jun 2025 19:49:25 +0800 [thread overview]
Message-ID: <20250620114925.2671-1-lirongqing@baidu.com> (raw)
From: Li RongQing <lirongqing@baidu.com>
Since virtio_fs does not utilize the fuse_pqueue->processing list, we
can safely omit adding requests to this list. This change eliminates the
associated spin_lock operations, thereby improving performance.
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
fs/fuse/virtio_fs.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 82afe78..7a598ea5 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -814,7 +814,6 @@ static void virtio_fs_requests_done_work(struct work_struct *work)
{
struct virtio_fs_vq *fsvq = container_of(work, struct virtio_fs_vq,
done_work);
- struct fuse_pqueue *fpq = &fsvq->fud->pq;
struct virtqueue *vq = fsvq->vq;
struct fuse_req *req;
struct fuse_req *next;
@@ -827,9 +826,7 @@ static void virtio_fs_requests_done_work(struct work_struct *work)
virtqueue_disable_cb(vq);
while ((req = virtqueue_get_buf(vq, &len)) != NULL) {
- spin_lock(&fpq->lock);
- list_move_tail(&req->list, &reqs);
- spin_unlock(&fpq->lock);
+ list_add_tail(&req->list, &reqs);
}
} while (!virtqueue_enable_cb(vq));
spin_unlock(&fsvq->lock);
@@ -1389,7 +1386,6 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq,
unsigned int i;
int ret;
bool notify;
- struct fuse_pqueue *fpq;
/* Does the sglist fit on the stack? */
total_sgs = sg_count_fuse_req(req);
@@ -1445,10 +1441,6 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq,
}
/* Request successfully sent. */
- fpq = &fsvq->fud->pq;
- spin_lock(&fpq->lock);
- list_add_tail(&req->list, fpq->processing);
- spin_unlock(&fpq->lock);
set_bit(FR_SENT, &req->flags);
/* matches barrier in request_wait_answer() */
smp_mb__after_atomic();
--
2.9.4
next reply other threads:[~2025-06-20 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 11:49 lirongqing [this message]
2025-06-21 9:21 ` 答复: " Li,Rongqing
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=20250620114925.2671-1-lirongqing@baidu.com \
--to=lirongqing@baidu.com \
--cc=eperezma@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=stefanha@redhat.com \
--cc=vgoyal@redhat.com \
--cc=virtualization@lists.linux.dev \
/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
all inboxes | Powered by JetHome®