Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2566240rwd; Sun, 28 May 2023 19:09:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7GUrd7HdGCOWx7zJaxfR4UQw+xrbjLxduI36cQQTpdGev/X50lvPyxjOh2+JXSOpnr71fv X-Received: by 2002:a05:6a21:329e:b0:fa:1f3a:8f56 with SMTP id yt30-20020a056a21329e00b000fa1f3a8f56mr7621137pzb.12.1685326182783; Sun, 28 May 2023 19:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685326182; cv=none; d=google.com; s=arc-20160816; b=zptkMLPQ0YzOANlxmHj6cNOMcJl8Yw5WXKvruwtcUItzMvKURWBKbG6lUTpunQJDOm RrczRs10dCtn3rdoazDIN8scfNmyQdBZXXTqIv37konn3b0amKeDyDrL1oh23zi/+TQd fMomHd95F+F1TuqAqqrBaAzp6C1M9pp137013eg7+kRJcDJLU4PaTNixFeUJv8CVTto7 l9i98TrT62reGW9cmilqEPxVw2vlFsdG6GTwTDgqwRiksgct3TecLzhSHJ629eUu27Vf +dkdyqRCKGQs0643SDvsRv0ALlWpnDcdzH0DF4hxQiES0XwLg4/TOosxabBMklt++dTo 1IVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tMptz3md/k3u0j9oroIGEgxylbsDqKqJab7LWdeLGdE=; b=lRKyWzHVJSpBqoNZ0UK9cYuC6k+zWOlE/KgypnZT1FH6uQDg5SpdUIOYTPSI7cIPTT HXKcs8PwwH7RZD+m4sVLSjZyhyS4VtkwvBIYjhEmQQ/iLtGcJa4GBeeA796HSRPcZf6N xj3nUuzIvKn7rYLC9cbKqXMSJLeQur2/6+Zw0kjE+zheuH+KVOmfY7+lcZ6RiJjdZNZc SW9cqH/H0Rfm99tPPK/8DkAVCgikzof8IHGTv8y0Ejfc3wJRUMGpWXt1QC6XTp1p/S9D KiLAbMOBnAdNElpu8zxgM/qqscqUCBwYU6S+ko3HZkqWiP9mJcvKzqMo+ruTnSjHmVLh qspw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k70-20020a638449000000b0053053f9837dsi8512038pgd.132.2023.05.28.19.09.30; Sun, 28 May 2023 19:09:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbjE2B5Q (ORCPT + 99 others); Sun, 28 May 2023 21:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjE2B5P (ORCPT ); Sun, 28 May 2023 21:57:15 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 411EDB8; Sun, 28 May 2023 18:57:12 -0700 (PDT) X-UUID: daab79a208784ff98e108a5844808a4b-20230529 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:567b328f-12ca-4442-b2a8-d379ba623739,IP:15, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:-5 X-CID-INFO: VERSION:1.1.22,REQID:567b328f-12ca-4442-b2a8-d379ba623739,IP:15,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-5 X-CID-META: VersionHash:120426c,CLOUDID:525c446d-2f20-4998-991c-3b78627e4938,B ulkID:230529093928BK5NKPIW,BulkQuantity:1,Recheck:0,SF:24|17|19|44|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:40,QS:nil,BEC:nil,COL:0,OSI :0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: daab79a208784ff98e108a5844808a4b-20230529 X-User: lijun01@kylinos.cn Received: from localhost.localdomain [(39.156.73.12)] by mailgw (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 404288243; Mon, 29 May 2023 09:56:57 +0800 From: lijun To: miklos@szeredi.hu Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, lijun01@kylinos.cn Subject: [PATCH] FUSE: dev: Change the posiion of spin_lock Date: Mon, 29 May 2023 09:56:56 +0800 Message-Id: <20230529015656.3099390-1-lijun01@kylinos.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org just list_del need spin_lock ,so the spin_lock should be close to "list_del(&req->list)", this may add a little benefit. Signed-off-by: lijun --- fs/fuse/dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 1a8f82f478cb..c3a0a04ea9b4 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -388,16 +388,15 @@ static void request_wait_answer(struct fuse_req *req) if (!err) return; - spin_lock(&fiq->lock); /* Request is not yet in userspace, bail out */ if (test_bit(FR_PENDING, &req->flags)) { + spin_lock(&fiq->lock); list_del(&req->list); spin_unlock(&fiq->lock); __fuse_put_request(req); req->out.h.error = -EINTR; return; } - spin_unlock(&fiq->lock); } /* -- 2.34.1