From patchwork Sat Jan 25 17:43:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13950474 Received: from outbound-ip191b.ess.barracuda.com (outbound-ip191b.ess.barracuda.com [209.222.82.124]) (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 B76D043AA9 for ; Sat, 25 Jan 2025 17:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=209.222.82.124 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737827066; cv=fail; b=WS/+sD8LR6RzCMHs0/cR6SKHGrY9P6UfIrYt6afU8c98mXS5+PWOxUigODX0tOotKCY0neg8/yF9JnPJxnFcKEnrdIhzv9ciYvCjR9GAODjsuXoTLS1zf1ao99uk364KI7AlqWihvKltz8RbjNUXTOXwZ2PhudpL1ZNvvds+GW8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737827066; c=relaxed/simple; bh=z+LkpxfZfeVxDdWJUNaYf2XD9eZE50Kw6bFrhhmhmSQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EJ/8QEa1ePmgVNYTfo3pWLipRMbw2XkkV0aKS93JbuQ5iwiHFNkcf+Yr8EBQSe1y4qaAogV2UKQ4t5U10f9sn/DHG4Z7Q6sNv/uFMoyOBs6Cay2gk60gMpW4/Wbw/W3JIDYGekOsWDyoslXGXIoIIrd84FUl8vKgxIWsYHDTPI8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com; spf=pass smtp.mailfrom=ddn.com; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b=X8IdVMAL; arc=fail smtp.client-ip=209.222.82.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ddn.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b="X8IdVMAL" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by mx-outbound-ea22-15.us-east-2b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 25 Jan 2025 17:44:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wMmhmUABUkXzlXj+vxXyXwEj/Al44KsJCVyddup/ID2ahljglGNL1i4GTJQxoW4kq+MGY1BK35s+ZZvlN88i2HdY9p9NxeM5v3c82rTq1MSwk4mF8UeVsLo4XE0gwo7eyyVJy918UIp/biLU5B7XvArorvyGOwZ5CZYgdgU2xy1WQzlqAjDpUvxMvviSEhPIg94wkEVuG4OxeORuCTEpmlwObsGGjn3br/HFuISPm/ZlZuyYc5hdrIxLX5jqF306fMOq7v11jOnzcRBpWw3/65xA3qYczzXfX7Y4mYSkh0EAMBsnmKwlqs19MKoRalky1j+vFenpvmxwcKVcIoe/0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9/2npZ9T/cU2JxXXXk8BqzZwsh/bxSF8L1abf9EV3A8=; b=DCmAr/qMHbysyFrRWWRu04wROq03ojhrONs/CCMEhbWS7hbJ9WmhjIOyIIjjYVQvZnEhg4+z0vJmsQlMQR3vEfYEs8AUOOpb6ieAaOZZVgWCYXtCSqj+O4Qb93pR8EcS4sYM3qvOlGpwT7mENx5nU+pm74bP+NF7XX/WKm3frtGQM68jpJzb3SUrqCHZt7LKXaU48oRR0s1+wmENrhdpsljS1DE8eb8QS++VJchTP6Etj7O9qgxgltmJ18kvJcz5V1PFKGFl2GZnok8T+kktDXo7vCyyfsBPtYsipKfXMpuXRqfnCi4eC6zH/yqmyvjfxpmx6t8DQ59e8cDzyW4T+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 50.222.100.11) smtp.rcpttodomain=ddn.com smtp.mailfrom=ddn.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ddn.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddn.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9/2npZ9T/cU2JxXXXk8BqzZwsh/bxSF8L1abf9EV3A8=; b=X8IdVMALyeTeF77BhhCLkMxGPxWLFCOT36TUozdBJTmm4n+D1q8fYqasr5Fxd6nIWncqLQtFsUPiTNSRX5HQH5i/FIt1175gHz3B+yCx5EfmIlH8o+1HblryCJ0FF7zNpC1p0PKYQOpRFAz4+kEXCXoC7kYfmGzWOSl0rnUkeJE= Received: from BN9P220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::7) by SJ0PR19MB4764.namprd19.prod.outlook.com (2603:10b6:a03:2ec::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.17; Sat, 25 Jan 2025 17:44:03 +0000 Received: from BN3PEPF0000B06F.namprd21.prod.outlook.com (2603:10b6:408:13e:cafe::65) by BN9P220CA0002.outlook.office365.com (2603:10b6:408:13e::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.22 via Frontend Transport; Sat, 25 Jan 2025 17:44:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 50.222.100.11) smtp.mailfrom=ddn.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ddn.com; Received-SPF: Pass (protection.outlook.com: domain of ddn.com designates 50.222.100.11 as permitted sender) receiver=protection.outlook.com; client-ip=50.222.100.11; helo=uww-mrp-01.datadirectnet.com; pr=C Received: from uww-mrp-01.datadirectnet.com (50.222.100.11) by BN3PEPF0000B06F.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.0 via Frontend Transport; Sat, 25 Jan 2025 17:44:03 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 27C5380; Sat, 25 Jan 2025 17:44:02 +0000 (UTC) From: Bernd Schubert Date: Sat, 25 Jan 2025 18:43:57 +0100 Subject: [PATCH v2 2/7] fuse: Use the existing fuse_req in fuse_uring_commit Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250125-optimize-fuse-uring-req-timeouts-v2-2-7771a2300343@ddn.com> References: <20250125-optimize-fuse-uring-req-timeouts-v2-0-7771a2300343@ddn.com> In-Reply-To: <20250125-optimize-fuse-uring-req-timeouts-v2-0-7771a2300343@ddn.com> To: Miklos Szeredi , Pavel Begunkov , Luis Henriques Cc: linux-fsdevel@vger.kernel.org, Joanne Koong , Bernd Schubert X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1737827039; l=1548; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=z+LkpxfZfeVxDdWJUNaYf2XD9eZE50Kw6bFrhhmhmSQ=; b=sKwcbSQN9Ek/OdQo9jOOUp0lnEne6txPC542All/wtI1fX5ie2pVk/mbRCIuJTpOjYVWvcJJo 1ySnwxnyPMTAGnlX+4cdTA8097Q4CI52rglCqAHf/1QHZz61Okh5a0G X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06F:EE_|SJ0PR19MB4764:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c73cc26-c89f-4746-f65e-08dd3d67dbb3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?q?u0kRKCF023fHDrBt167RG4oTYARAy71?= =?utf-8?q?vvTUwV7JHgreavdI2oszhIW9lClNMTfzN+OhKa7ZlPBAaP7uoA0zIWo0MvmA6tlW0?= =?utf-8?q?j7aB5M+q8hJKQYRnpqeljzXeKzsTV+EHGVJJFVDIri2MEeaNHzVfJ/yONKxbH1NCD?= =?utf-8?q?FhnGjInnPuM8I0Zt3nS0/Ne8OYPwKNLewTIu9enz3yJLdvgxhgx+iKIPV2NXHjKWE?= =?utf-8?q?O2UR4LNVEgB8O19UAu5hApUF5Ky1ScNkeEJjgc0e/LImzu70HHwhYuDcVwzjM8fd4?= =?utf-8?q?aG3Nr6j4J2snRNviuXQOWao+iCDn/BB5awpyb5t01quxJHpmLbWGkh4sqAP65k/vg?= =?utf-8?q?zj3sAN44mWzrshbZjI+7W4a1dzDMq3ywHXiSyjAPCO3JIvm/QRpPw3LMsksfUmeCJ?= =?utf-8?q?HqyC/jgYq/QJtRN2rLhE4hNyCxpx0y5sFI9AvPbKjDJDhJersnTpONc9FODPfeGRC?= =?utf-8?q?ARMKDW+AEIEvdjtlWTiz+SMjWZfdGX5ApF7ULCx8rxKy+s8dBEyNRGyQK2hweSXL5?= =?utf-8?q?q9iuHXkzu0Cr55DJ6QRbnFGksoi5i4Kw3aPr2+rfUIMGt9U0gfxofXI5QrjijSfbG?= =?utf-8?q?24AxdN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100.11;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:uww-mrp-01.datadirectnet.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: OPymsK0zC7IT5aXJEV+x5FeX/NJndttfErIknTmKzmE/O82myXB7IgDICMWax0HgGBSeJElFs3fJ337ecltzFM5zeQKLs6itUlwtKGV+SB8hxCZv+lyWsNwCWm9EPak/RsXPjUdSjApjx/LZSdsU9G1Ebhx9NoPRcDk2BRjokAmUNSLfOpV+tcQUlFIFi7I4pN0hXjy/uIaYWT4OG/gc7HaYmmLePnyqmT8QeQGjUDib0kybnkPbak3qaTCiVwXrAdDKP43fTj4ffIUNHd3HURdEKIMevpoo1TgQip96ghL/Tj+ljyFQztpxiZemvB5pFrzc++gDFG2AVnpZ+vDLH1iavWRoLiQJemjk1Ko/Nx1pHf3svjZAJo29FFWL6dtG7cXm/rH81ADAzcAsX2KAUx8UH+NKtssldrpejFSKum3lPCB8vR57NRM8nST+cxCF8RZ7xKE8FfOkxgPqwqzf3J1hD7BBTKkqAXWU/g8SGifW46oN/osoYlwlUnHlvXQazBQrRbqm7u4LdvvgOfIOlLfWPmGshM9aYfrbRlHVu7Q2+nh17K8zUROuKg6qliMoIy+6ek+7heFQHlmKlDYUcIg/GuFHE1lae7D7CUsQ8KCc7C5ci7UPGWLUbSi9fd45AJsDknN/Y1ZmppxjR78gFQ== X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2025 17:44:03.2002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c73cc26-c89f-4746-f65e-08dd3d67dbb3 X-MS-Exchange-CrossTenant-Id: 753b6e26-6fd3-43e6-8248-3f1735d59bb4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=753b6e26-6fd3-43e6-8248-3f1735d59bb4;Ip=[50.222.100.11];Helo=[uww-mrp-01.datadirectnet.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR19MB4764 X-BESS-ID: 1737827045-105647-32589-1675-1 X-BESS-VER: 2019.3_20250123.1615 X-BESS-Apparent-Source-IP: 104.47.55.169 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoamhgZAVgZQMCXRJDEp0TjJJC XZ0CgxydjIKDXN3NgwzcA8ySDZ2DJJqTYWANdKaR9BAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.262052 [from cloudscan21-33.us-east-2b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 fuse_uring_commit_fetch() has obtained a fuse_req and while holding a lock - we can use that for fuse_uring_commit. Fixes: 2981fcfd7af1 ("fuse: Add io-uring sqe commit and fetch support") Signed-off-by: Bernd Schubert Reviewed-by: Joanne Koong --- fs/fuse/dev_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 2477bbdfcbab7cd27a513bbcf9b6ed69e90d2e72..3f2aef702694444cb3b817fd2f58b898a0af86bd 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -796,12 +796,11 @@ static bool fuse_uring_ent_assign_req(struct fuse_ring_ent *ent) * This is comparible with handling of classical write(/dev/fuse). * Also make the ring request available again for new fuse requests. */ -static void fuse_uring_commit(struct fuse_ring_ent *ent, +static void fuse_uring_commit(struct fuse_ring_ent *ent, struct fuse_req *req, unsigned int issue_flags) { struct fuse_ring *ring = ent->queue->ring; struct fuse_conn *fc = ring->fc; - struct fuse_req *req = ent->fuse_req; ssize_t err = 0; err = copy_from_user(&req->out.h, &ent->headers->in_out, @@ -923,7 +922,7 @@ static int fuse_uring_commit_fetch(struct io_uring_cmd *cmd, int issue_flags, /* without the queue lock, as other locks are taken */ fuse_uring_prepare_cancel(cmd, issue_flags, ent); - fuse_uring_commit(ent, issue_flags); + fuse_uring_commit(ent, req, issue_flags); /* * Fetching the next request is absolutely required as queued