From patchwork Thu Apr 3 20:22:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 14037567 Received: from outbound-ip168b.ess.barracuda.com (outbound-ip168b.ess.barracuda.com [209.222.82.102]) (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 C1E0D1F03EE for ; Thu, 3 Apr 2025 20:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=209.222.82.102 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743711788; cv=fail; b=LLbF+w867OaDn3jm0Pic1qlh6bQVpHLZGlio6R8cj/d75SFB31ipU03XtOZd/mD2of1FRDvQ4Ob/86AouWu60ERiL6wxDTUEGYJ4ie/GHdIPGleV5IfvD8TMmi6cAJHFagMX7eoA1jIVc/jqp26NXHT99+dK/p9EPbsyRLnylM4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743711788; c=relaxed/simple; bh=+H5d4+HjaXggM1OVhJ66708re3e0BUKtpHGh11I8B3E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EAU+1v8Q7iefrVmkw15HCBl2Y5nlJ7wzVw+67FKTH1m9pb3OLXWtz9SGv4TlWnowIzoixPXmcM/u4ycvnHQCUn1FvrNB3xwVrxbkcKLtfjAF96G22VgzZcgYeXzyu0coGWLDNRp97tmSEnirQIH9KTHNCkMETI4UuCyFeiSKlqM= 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=hKWQwvMY; arc=fail smtp.client-ip=209.222.82.102 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="hKWQwvMY" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2176.outbound.protection.outlook.com [104.47.73.176]) by mx-outbound22-67.us-east-2b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 03 Apr 2025 20:22:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nHO3B+2KjACLpBANiLo3rda9+N2WRookNK92CE55jZ8X/xfs/PvstK1l8GSu5F+WzL8zWtw5E0/cNEfEXnQeQdY3jVE8bzEctrj0tfDOolm4vpncRO8tSLgj2sXadpmqeum+ttbMsTYPLnBK9rxHTUbfxRj+28HBGhln6DYACSew1B7+VSDOTQfXyY5z4wEP9CEUADj81xvFv6TH7UZk2fsM4B+qQolmvJYcD6zqNhsFP8NDgNElSUfSMPecRC8wIcSBWfXSo/G2VYNFwZjhXAbMBQ4bwV3PCjdwaMQa7uHkYgDClY1xR3H1cKHPoIq9hXgmaq2tQWLmQoYZhKfqIg== 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=mnWArgEZ/mERbronoBEh1oTWNMpbuidXjFCxeQHpW+U=; b=isLvRbT+dFgf79RNj6Dawp2lUqwMiiwxerSF01qzZR8modJ4xTT9qi01DaCGfujQDNMkw2k5l/86h3lHe6ydz9G8pUV0iEi/n/FyWfbNUG8yktTaZNTQ+EEkcPJxlytX8Wg11609ZOrwGuHK7OWnu+zY6yvrg3uNSc4Sq+eGb5PxohunIUkvXycXiWoL/8ie49zVVzjbrFikmE6b7G68ayjMkN2szQJYkrkRP7gtWW+sfUDUDPj8o21M53bsg/3+Wz9tFbqWx2XS+ICXq+eM0pBQOLvjPSrnKkiBceYGbYIreUmqc8AU0Qo1kqOQ3bpksQFbPZ43CQpAM6sOWrZPQA== 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=mnWArgEZ/mERbronoBEh1oTWNMpbuidXjFCxeQHpW+U=; b=hKWQwvMY1kj5zm4HM0kJ7/yG4FnlJk+/gGxzEUKpCacLdeuEofxgZYW3fgnT0QvwvNogtX3DJMBqs+G+o5KpTY63E5pn7DsOdmbHSox+buF+QsPaanW69ks7+5gvRDUOWKLSZZTlbOvPI3tmc/LCsOvuDCBXii2RYEEA3PZv0hU= Received: from MN0PR02CA0015.namprd02.prod.outlook.com (2603:10b6:208:530::16) by CY5PR19MB6243.namprd19.prod.outlook.com (2603:10b6:930:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.50; Thu, 3 Apr 2025 20:22:51 +0000 Received: from BN1PEPF00004684.namprd03.prod.outlook.com (2603:10b6:208:530:cafe::53) by MN0PR02CA0015.outlook.office365.com (2603:10b6:208:530::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.26 via Frontend Transport; Thu, 3 Apr 2025 20:22:51 +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 BN1PEPF00004684.mail.protection.outlook.com (10.167.243.90) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.22 via Frontend Transport; Thu, 3 Apr 2025 20:22:50 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 7194F4D; Thu, 3 Apr 2025 20:22:49 +0000 (UTC) From: Bernd Schubert Date: Thu, 03 Apr 2025 22:22:45 +0200 Subject: [PATCH v3 1/4] fuse: Make the fuse unique value a per-cpu counter Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250403-fuse-io-uring-trace-points-v3-1-35340aa31d9c@ddn.com> References: <20250403-fuse-io-uring-trace-points-v3-0-35340aa31d9c@ddn.com> In-Reply-To: <20250403-fuse-io-uring-trace-points-v3-0-35340aa31d9c@ddn.com> To: Miklos Szeredi , Vivek Goyal , Stefan Hajnoczi , =?utf-8?q?Eugenio_P=C3=A9rez?= Cc: linux-fsdevel@vger.kernel.org, Joanne Koong , Josef Bacik , Bernd Schubert X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743711768; l=5386; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=+H5d4+HjaXggM1OVhJ66708re3e0BUKtpHGh11I8B3E=; b=F7l4k4+s3In7gEId7C/PGWGtFRnXiCjfmqPVzwVEndukhqoHOZOngQ381YRZXrQsDmLGVsTqg nNCQlMi8s/3B6RnT1p+LY2DT0zMZUW403/7mqI9lTe33uBDVC+h3a54 X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004684:EE_|CY5PR19MB6243:EE_ X-MS-Office365-Filtering-Correlation-Id: b449b176-d214-47d6-0f7f-08dd72ed4e7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?2F38YvAtFLzhexupIKp9vw/vBmNWmOV?= =?utf-8?q?q7g/mfHbk6s3qkZfFRrLf2OdkqEEmAeQMuiyKcrmN7hxfeXOFHpbUikvsyLr2nZgl?= =?utf-8?q?5D3I9zxCW36y60RcXzqP0/IW8V8/S73G8tFVCisxgR8JFA5Djl6qoBeIUdh9dtFyW?= =?utf-8?q?wesWGYg1DNiEr53vUsfJHgbvqQZRsX88YSV+c/OsuyeCkfi587JHDbUGAGOLnnAgS?= =?utf-8?q?UbcSuimFto5hC1+C8zHJFLVq1jptTUCSDY4sYCIS2xEgQdNkiLCHxHqkJ+3+yRqIG?= =?utf-8?q?KeroArLcJw94Gf2IYGruRKH7+nkurJALTjlcw4SiQwClkbh1EKW9EncBFgt6j0SBJ?= =?utf-8?q?cXJxIW7IzdlX4XxVg2zbOCR32SD5xldnn8NPIMmXsvv+fCgflyBWj8ZK05Q/+VAkS?= =?utf-8?q?tIkh1RfK58AkW3ibDuh/UOj+ztFlKMmLd6yBhn5C7JD2RtLnajpYvJBj2Raii/a/m?= =?utf-8?q?hxD4SeHNNrIwzoUzYS/fYSI0ObNrcUJLE80bZCHOa39SBU2u0YYxlgOj/DBPpKS/4?= =?utf-8?q?CbBuPHothhXymrsyM87n+m7IevNzxAG1yRZ0J++pRN7fy4j37Ja9ebJSnBVK0oQtX?= =?utf-8?q?0tTkpJoc1veweQD8DteCEXq8o9tYcwSlNeypTGOslJlsGMsuRgzU438niTaNl94IS?= =?utf-8?q?zOIS/qr4HWkpgg71D/auWbpRbwX1l9AlgbXq2eGi7JGmqd72aBm+M/X5zeSDmjqCo?= =?utf-8?q?5WwRwnlLXiy+PaP2t79Dd25OtTq+Xo4CYPP8uyH/US2yHeYAmLK9LsirSndNvhd03?= =?utf-8?q?PQTH2ocqNYsMhGEWXIExUfAduR2Dil7yq4F4frj0rFUTVuH18S7XnXkk/JmeFpVGI?= =?utf-8?q?itp/AIDvvym9+eATJUsQ5UvyqBXKoykH8RD6Ee+QgqNeQOyQk6HE5cfqKcjVTSNJR?= =?utf-8?q?t5WoCESOoLcpQAZGh+WeRUhqhrpPEJXk4zdikDZ5C7z3Tn1HN5gJ0FcsOJ+YBKDOz?= =?utf-8?q?f/ZUjSNuAh6pcnGmom1FNvurJTwIgwqhjJR8AYV/Epj4G5GSBkimMUn/2yqSCxkFk?= =?utf-8?q?lRnuSPjSyB1QU97kPECy0x4kgKQcRb8UyHZETmtYC8awluWFtVgFiErQwzmCdcAza?= =?utf-8?q?zY3Za52po1q7/ApH42y4KfSnPS9GKHs14992ZyxoRGHow+BKX3ItctVJ40JC1O7PU?= =?utf-8?q?Apv8btUjuRdruMDsxdNgFRETJEVvmI6N1wfiBza+f2h6IPLSeCLT8q0zQjEzayzm0?= =?utf-8?q?sy9lmbP4g6ywKG7JD03QPmZtC9+nR8aOL61zdHeyt7EDM/5jxfe8fyA/ecfi/OyVE?= =?utf-8?q?goZYDrre/0BS2VDzRKQjeaVkf7luaXGU9WHkKRhde5V/nZ9CSVDKh0qGvVwa4Tqmz?= =?utf-8?q?i9mZUNClHH448NHqMXjkLzk2yL+zymTH2KTru1VkKosGpgMxyR/Nvy+WW6Qvg31DX?= =?utf-8?q?j2Ucx2ULY0ycjQtxwyFhzAydVOR6wGFzpGgebOyZn3CJhEW5taR3AI=3D?= X-Forefront-Antispam-Report: CIP:50.222.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)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bfyIMm+2Q+UGBKnU6RvUr4Hf0OWo2FiSlRm1ip7WnUvJcdVCHsa4Mifr/8tqYhOumWa7mzfePDaQqEv0Zy0SW7s+QuxXaF1s7D0b1xmEFMxGact2zpmfB8Jh51vEzuRGvyQyHgsNYJ17/UbkCmTlijatPPoNhWnaNh+3eDpy+JLK5KlLr0ChHGPJcIZJbO+cLGpRECQ6etvt5WPeFLPQYwv6b9KUXfPIUzwhB8qV15xWxsX9hvCTuIyapzkgWOvLPCUEPBDzRyIT5Lz5sGXL4tzpQt8MLHuSWI1aE7aI+ZSJLkuEeH1hVfzbluYMhXCMtiVWqe912wFaN9eRkUeYRW99IhR1yoxDgQCsTVKsRT+tyvrUJ1bN6+SqKYmb/MQzXC11hfbJn/WzjMvJ4zdlE6QRt6UC44nukzB9ZdY7oQ/AeOj6xJgAA5xjtKBtL0N7pztEA+c/zvOUWf3fo3mhnaowYyJFjkZvrr8UBVyk0Zu8rm4m5951pwn6lzbaxqi45qC/9UdqTVF3pKk6tTp2K/sUwd87Yv3r9Ry+n7OmqcWUMimuAHFpmZ+4ICWv5y9fY9Xj2yqEzNr2AV5pzyQTV3eaVqSR4+85FMaArSwt+a/S5Ypal8qGVZyJiUTOWzchDnh96mPXeVyyia2bB3U8eA== X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 20:22:50.3678 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b449b176-d214-47d6-0f7f-08dd72ed4e7e 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: BN1PEPF00004684.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR19MB6243 X-BESS-ID: 1743711775-105699-9992-81-1 X-BESS-VER: 2019.1_20250402.1544 X-BESS-Apparent-Source-IP: 104.47.73.176 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqZGhiZAVgZQ0CQtKdkyOTXN3N LM0szQyCAlOdk0LTHNwtQ40TTJwMRIqTYWAHA+3YVBAAAA X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.263629 [from cloudscan22-245.us-east-2b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 No need to take lock, we can have that per cpu and add in the current cpu as offset. fuse-io-uring and virtiofs especially benefit from it as they don't need the fiq lock at all. Signed-off-by: Bernd Schubert --- fs/fuse/dev.c | 24 +++--------------------- fs/fuse/fuse_dev_i.h | 4 ---- fs/fuse/fuse_i.h | 21 ++++++++++++++++----- fs/fuse/inode.c | 7 +++++++ 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 51e31df4c54613280a9c295f530b18e1d461a974..e9592ab092b948bacb5034018bd1f32c917d5c9f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -204,24 +204,6 @@ unsigned int fuse_len_args(unsigned int numargs, struct fuse_arg *args) } EXPORT_SYMBOL_GPL(fuse_len_args); -static u64 fuse_get_unique_locked(struct fuse_iqueue *fiq) -{ - fiq->reqctr += FUSE_REQ_ID_STEP; - return fiq->reqctr; -} - -u64 fuse_get_unique(struct fuse_iqueue *fiq) -{ - u64 ret; - - spin_lock(&fiq->lock); - ret = fuse_get_unique_locked(fiq); - spin_unlock(&fiq->lock); - - return ret; -} -EXPORT_SYMBOL_GPL(fuse_get_unique); - unsigned int fuse_req_hash(u64 unique) { return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); @@ -278,7 +260,7 @@ static void fuse_dev_queue_req(struct fuse_iqueue *fiq, struct fuse_req *req) spin_lock(&fiq->lock); if (fiq->connected) { if (req->in.h.opcode != FUSE_NOTIFY_REPLY) - req->in.h.unique = fuse_get_unique_locked(fiq); + req->in.h.unique = fuse_get_unique(fiq); list_add_tail(&req->list, &fiq->pending); fuse_dev_wake_and_unlock(fiq); } else { @@ -1177,7 +1159,7 @@ __releases(fiq->lock) struct fuse_in_header ih = { .opcode = FUSE_FORGET, .nodeid = forget->forget_one.nodeid, - .unique = fuse_get_unique_locked(fiq), + .unique = fuse_get_unique(fiq), .len = sizeof(ih) + sizeof(arg), }; @@ -1208,7 +1190,7 @@ __releases(fiq->lock) struct fuse_batch_forget_in arg = { .count = 0 }; struct fuse_in_header ih = { .opcode = FUSE_BATCH_FORGET, - .unique = fuse_get_unique_locked(fiq), + .unique = fuse_get_unique(fiq), .len = sizeof(ih) + sizeof(arg), }; diff --git a/fs/fuse/fuse_dev_i.h b/fs/fuse/fuse_dev_i.h index 3b2bfe1248d3573abe3b144a6d4bf6a502f56a40..e0afd837a8024450bab77312c7eebdcc7a39bd36 100644 --- a/fs/fuse/fuse_dev_i.h +++ b/fs/fuse/fuse_dev_i.h @@ -8,10 +8,6 @@ #include -/* Ordinary requests have even IDs, while interrupts IDs are odd */ -#define FUSE_INT_REQ_BIT (1ULL << 0) -#define FUSE_REQ_ID_STEP (1ULL << 1) - struct fuse_arg; struct fuse_args; struct fuse_pqueue; diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index fee96fe7887b30cd57b8a6bbda11447a228cf446..80a526eaba38aa97f6a6faa60e5276fcd7f2668f 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -44,6 +44,10 @@ /** Number of dentries for each connection in the control filesystem */ #define FUSE_CTL_NUM_DENTRIES 5 +/* Ordinary requests have even IDs, while interrupts IDs are odd */ +#define FUSE_INT_REQ_BIT (1ULL << 0) +#define FUSE_REQ_ID_STEP (1ULL << 1) + /** Maximum of max_pages received in init_out */ extern unsigned int fuse_max_pages_limit; @@ -490,7 +494,7 @@ struct fuse_iqueue { wait_queue_head_t waitq; /** The next unique request id */ - u64 reqctr; + u64 __percpu *reqctr; /** The list of pending requests */ struct list_head pending; @@ -1065,6 +1069,17 @@ static inline void fuse_sync_bucket_dec(struct fuse_sync_bucket *bucket) rcu_read_unlock(); } +/** + * Get the next unique ID for a request + */ +static inline u64 fuse_get_unique(struct fuse_iqueue *fiq) +{ + int step = FUSE_REQ_ID_STEP * (task_cpu(current)); + u64 cntr = this_cpu_inc_return(*fiq->reqctr); + + return cntr * FUSE_REQ_ID_STEP * NR_CPUS + step; +} + /** Device operations */ extern const struct file_operations fuse_dev_operations; @@ -1415,10 +1430,6 @@ int fuse_readdir(struct file *file, struct dir_context *ctx); */ unsigned int fuse_len_args(unsigned int numargs, struct fuse_arg *args); -/** - * Get the next unique ID for a request - */ -u64 fuse_get_unique(struct fuse_iqueue *fiq); void fuse_free_conn(struct fuse_conn *fc); /* dax.c */ diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index e9db2cb8c150878634728685af0fa15e7ade628f..d2d850cca4c7bc3cd7158e773c5e602e15afe4e3 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -930,6 +930,7 @@ static void fuse_iqueue_init(struct fuse_iqueue *fiq, memset(fiq, 0, sizeof(struct fuse_iqueue)); spin_lock_init(&fiq->lock); init_waitqueue_head(&fiq->waitq); + fiq->reqctr = alloc_percpu(u64); INIT_LIST_HEAD(&fiq->pending); INIT_LIST_HEAD(&fiq->interrupts); fiq->forget_list_tail = &fiq->forget_list_head; @@ -938,6 +939,11 @@ static void fuse_iqueue_init(struct fuse_iqueue *fiq, fiq->priv = priv; } +static void fuse_iqueue_destroy(struct fuse_iqueue *fiq) +{ + free_percpu(fiq->reqctr); +} + void fuse_pqueue_init(struct fuse_pqueue *fpq) { unsigned int i; @@ -994,6 +1000,7 @@ static void delayed_release(struct rcu_head *p) struct fuse_conn *fc = container_of(p, struct fuse_conn, rcu); fuse_uring_destruct(fc); + fuse_iqueue_destroy(&fc->iq); put_user_ns(fc->user_ns); fc->release(fc);