From nobody Thu Oct 9 02:58:39 2025 Received: from baidu.com (mx24.baidu.com [111.206.215.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4910430E841; Fri, 20 Jun 2025 11:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.206.215.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750420223; cv=none; b=oj41v4V/uftzu2d4XeX/PMNYtyMRV03+dup603LMNlgaJBIhXBzZ8/SrNgywCiJhlHzKn8gvvYvLZUOawzb75Y3t15eqVTT+V+lxk0cEXqicY4dJcGNhVn58JiXcb2xxLblSQ++f1IbkP05LXuUJ6+XenBNJy5y6ZGebl7AHZ2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750420223; c=relaxed/simple; bh=nkpgK2qx0Maj3Ks5WDMYbHXp9o2yShyl8cyss/4J/sQ=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nxpVkTsf6BeJbi3YKJxErw68JCqfkdbAk3cpXuB8reO2LD4B2axsm/WM1taMlISvPB8XBgdePdjuLQhFu9tPHnKi1gHmUnDdg2ZiBjQVEOaeL4VyCsywBPlLuWStIB5kXYWSFKC4lRNpWYeq+xK4horYxwNPqS2ZfKYTkPhqPMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=111.206.215.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: lirongqing To: , , , , , , CC: Li RongQing Subject: [PATCH] virtio_fs: Remove request addition to processing list Date: Fri, 20 Jun 2025 19:49:25 +0800 Message-ID: <20250620114925.2671-1-lirongqing@baidu.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: bjhj-exc6.internal.baidu.com (172.31.3.16) To bjkjy-exc3.internal.baidu.com (172.31.50.47) X-FEAS-Client-IP: 172.31.50.41 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Li RongQing 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 --- 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_st= ruct *work) { struct virtio_fs_vq *fsvq =3D container_of(work, struct virtio_fs_vq, done_work); - struct fuse_pqueue *fpq =3D &fsvq->fud->pq; struct virtqueue *vq =3D fsvq->vq; struct fuse_req *req; struct fuse_req *next; @@ -827,9 +826,7 @@ static void virtio_fs_requests_done_work(struct work_st= ruct *work) virtqueue_disable_cb(vq); =20 while ((req =3D virtqueue_get_buf(vq, &len)) !=3D 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; =20 /* Does the sglist fit on the stack? */ total_sgs =3D sg_count_fuse_req(req); @@ -1445,10 +1441,6 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq= *fsvq, } =20 /* Request successfully sent. */ - fpq =3D &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(); --=20 2.9.4