From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 813BF369D4B for ; Fri, 29 May 2026 03:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780024336; cv=none; b=XzFC/2pEEJBj3AlBYU86h3fv4HafJ3cgzyjsPU+D1sNIkXDsJtJ6qMNjeahcorJKBKZ/0XWPWzBteE3S6fXnwCl104UCUvBzkeXw1Clhkuc4aQjte9+e5SJQFgWeHjRw6egp7J7P2S/AUMfhXlntIekvnJ2aXu2zTsqZDqxhF8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780024336; c=relaxed/simple; bh=/u4f4FgZyBWtjbRRaaWz9qfOmIy3D/4tMW3teTl0wq8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EuoxXSNo1h0UVxkGV3QwUIUUxq8A2ELG/ON/W/3BOQKBZREWPudiDd9u7Uz2xwI4/C7XzfHcDqnJfB8sb4qZYlNTNKmCWVM/GGjixnfDEtTk1iFCuiGt7B2oehNeCgK5iAITihNfk9NURhBeZlBOoyS2BaDhqujSFhxLedX4MgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WKYZnF9m; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WKYZnF9m" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7e615efd7d7so5329247a34.2 for ; Thu, 28 May 2026 20:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780024334; x=1780629134; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=G9Phfc/ZC4dml+VHPh7TrqnGY9YxNLE5sIFguW0tl3Y=; b=WKYZnF9m2PwiId2djXLTRS3ChFGckUjuRJYaEDmXknZimvZ9pX4+OyHs8E5adHNFmR c5ecBpfiDl0fPzPjT2WXGBn+fqii+LfyZqRJwVvO3/IqEmjKau9rsk9p9a4syCp5Hy9t T8ABmbpkQkPhC5BRXJtDYbNqzsLB4+adw97Rc9eKHmL5uYJ+mCmzFjaW8KwaPxiFaSYC IHihDkxf98GnouT95RffrFjqSwC0w2baK+2ryom+RtpsTDnkpoabQZcDmxxttY7OVVpU QWHqp/CsB9iEUP6w2FFmWNUTXUrFGMjm7HQsSFmCiYe2hwPioE2VvgXHHuGNktrupSOB Dd6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780024334; x=1780629134; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=G9Phfc/ZC4dml+VHPh7TrqnGY9YxNLE5sIFguW0tl3Y=; b=BrqG5h5Y+wqgNnw2FqURCKq9h/XDTG9qklrS3BOe68L5rJcI9xgy993nRrYaQR5rd1 P2u10yKoW7UYlQfRc9jsEISDq0X4VjIScm9xfXvO8qYguF5H//1nNJA/UBFlhAjTcGPA KwPYZodCSyrfANF46cfoCLfhOlCd/c7LbBQ4dAxQNGR9MVqwHBGuLrle2CHssIjvaSQm rjmDdsB3uR6KAy4flX7IRgy7pgb5AWgunyDhEkjTFs7I5zs6P/x9JEd+jyDdeQmSAXFH m76rUZSFZbk65LrHXrifM4Tl095FmeQwYKZE/5uyKuI8tC3ejNtpnRrL7BWX7rSUwbN6 EwKA== X-Forwarded-Encrypted: i=1; AFNElJ8hQIuofpZnZbyoctmLTF9bJl6kKmYtGh9jOvz8QzKilzgpIDUBLs3eNUgQO1+y+ehsuCxexq+IJsm33eA=@vger.kernel.org X-Gm-Message-State: AOJu0YwezomzVsdm+9WhMbLMYkk5h9/B19HX5J/9f5w9cwRck1QhOJUg 4gXoOTRh7cB4EXY5Ifs9GLd8Q33jsP3RV/YlnoAWZS2jnI28CjsPWYol X-Gm-Gg: Acq92OHsyvCkV9XLGteOX22mwYdspzz0gvb0N46KsaFbXUsKVdUSwavw1d2tNdiKCuG P+bOuJQEDbhdaXHE/2dI/AXbxi7LNaArWeotaX6FZBTDO8hR4CgztRgeva4MC+/atyo6U2jlNFa ozGy4KUrLK0kzG3jtY5tFPgoQ6ikJwi1FpWJ/NWrXCtphXpeRj7o49I5CTpXh8oPl11I80FjTxj dIAal/3goE5NKfYfNA7otTG//4r3L0Lr3fF2Ww89l6dZgAUnhzU3mfWFMfWp7kKQjBJcWjzxw/8 7pcDZwnX91xRiv2DGzItPH0qpSMvlJ8TtLK/42diirTEybuxuQyzqw7H4AEKFrT9f6d8qTavQZ0 Pkb3r65529A8fPrkog1W5q6412tKMCmW7nNeuCPUct/STLEt0hOjt/7IoKaUsgm3O9BWFkYNKEz 9nl/ALb+yF9PUyvzYgZdu0YklCoTHosqlBV/dRA9V2d2fHQ/FZEn6j+eY9FkqmCkg+NjVrtAaMI gY6Grx/ISS9WGEJG0RHePw0xSoBtHXnBRJg8ltMIFknzHSfCjNdHq8Qc8zSZDiffw== X-Received: by 2002:a05:6830:610d:b0:7dc:e032:9b5f with SMTP id 46e09a7af769-7e694e215ecmr723960a34.25.1780024334549; Thu, 28 May 2026 20:12:14 -0700 (PDT) Received: from rdf-gcp2.us-central1-b.c.storage-xlrait-66065.internal (163.80.112.136.bc.googleusercontent.com. [136.112.80.163]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e695d65e6esm548861a34.20.2026.05.28.20.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 20:12:13 -0700 (PDT) From: Russ Fellows To: linux-fuse@vger.kernel.org Cc: miklos@szeredi.hu, linux-kernel@vger.kernel.org, Russ Fellows Subject: [PATCH 0/2] fuse: fix and optimize parallel writes on passthrough mounts Date: Fri, 29 May 2026 03:12:02 +0000 Message-ID: <20260529031210.7021-1-russ.fellows@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit These two patches fix a bug that causes FOPEN_PARALLEL_DIRECT_WRITES to have no effect on FUSE passthrough mounts, preventing write IOPS from scaling with concurrency. The bug has two sides that must be fixed together (patch 1/2): (a) fuse_passthrough_write_iter() calls inode_lock() directly, bypassing the fuse_dio_lock() function that checks FOPEN_PARALLEL_DIRECT_WRITES. (b) fuse_file_io_open() strips FOPEN_PARALLEL_DIRECT_WRITES from any open that lacks FOPEN_DIRECT_IO, including passthrough opens where the flag is redundant and should not be required. Either bug alone is sufficient to serialize all writers. Together they ensure the flag can never take effect on a passthrough-backed file. Patch 2/2 is an independent performance follow-on: once parallel writes are unblocked, the per-inode spinlock (fi->lock) becomes the next measurable cost. This patch converts iocachectr to atomic_t and adds lockless fast paths to fuse_inode_uncached_io_start/end and fuse_write_update_attr. Tested with fio randwrite 4K direct, numjobs=1/2/4/8, iodepth=64, on a FUSE passthrough mount backed by XFS on a RAM-backed null_blk device (kernel 6.17.13, AMD EPYC 9B45, 16 threads): numjobs | Before (IOPS) | After patch 1 | After patch 2 --------|---------------|---------------|--------------- 1 | ~470K | ~470K | ~470K 2 | ~650K | ~930K | ~930K 4 | ~640K | ~1,530K | ~1,530K 8 | ~635K | ~1,707K | ~1,707K Raw XFS throughput on the same device at numjobs=8: ~1,702K IOPS. Russ Fellows (2): fuse: fix FOPEN_PARALLEL_DIRECT_WRITES being ignored for passthrough writes fuse: reduce fi->lock contention on parallel direct I/O fs/fuse/file.c | 49 ++++++++++++++++++++++----- fs/fuse/fuse_i.h | 11 +++++- fs/fuse/inode.c | 2 +- fs/fuse/iomode.c | 61 +++++++++++++++++++++++++++------ fs/fuse/passthrough.c | 6 ++-- 5 files changed, 104 insertions(+), 25 deletions(-) -- 2.51.0