From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 0975E2E739C for ; Fri, 29 May 2026 03:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780024764; cv=none; b=YNYAeuPpZUFs6zngkIJRHYfDAgUd/w45lrZr0DBGYoLaeIK+DLU4NgFyyCfsNJeqP4ctFVrXYd/SpJ90QjvTd2w90aVvbVCKUPvcEmLnMpy8QfELJOYKoZhV416P0lZDnHdzePvmXUhRolt4nmCIbmMmWiSKU++6SOGYQFInuaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780024764; c=relaxed/simple; bh=/u4f4FgZyBWtjbRRaaWz9qfOmIy3D/4tMW3teTl0wq8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tv5ZM9/OXgVhFkDS2PYFr6xfIcPbsDK9z2GD5xUf6Y9ugjyNufs933GvwVxKlJOVwozeVc4sBGIgE6tziAuY2wh+rUQrVtWvULxX9bfYN3svFDkA/QqujfVAvFmO792i3SjJlIymAQARbM0DpitSn6o8I7QpifRxHUxcFld+geo= 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=qsYFYcGD; arc=none smtp.client-ip=209.85.167.181 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="qsYFYcGD" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-482de4ef03aso8269876b6e.1 for ; Thu, 28 May 2026 20:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780024762; x=1780629562; 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=qsYFYcGDy7qY9+MxYJcPSef8gXiUoFElHGSUYNTG11rrRK6JTCZq8f1mBX1SOl8gDd /YXwvq5//znuxUN5/yUHEAHX5XTk0Pfk9xgj46ODV29NYCfWGEdz2AP+2Of1INa8ptpK PQ5tbRUc+5aciyudWMsDabyQy4FBk5uoUu7zGeFsp/c/AbSCamVlO4J/+i4mRg20QzUW 5mdZm0gdrFftG5/jdR0F8BVih1wuI3Nm9Z6RGB68UGQqO9pFmFA2KPmixz0nLLb87UKw 4hY/YBjnEKlUADN7t1mpUlq2LmSyhs7FJLPsGYnhZz2nWxxp88EpTcdpljKm/hvWFxAi dATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780024762; x=1780629562; 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=g2l74CTyuDcIND+LlIrKTlp6VhqwcH95sn2Y/fi8BJTEhNd2oF9+5ja6SjuNSgH0xm rT2fOBtM5TCQEWMtC3z4XbdinTMOEtVunehK+LoyQxG79sDfVDSDT0VaqXUD+Y5MJZhZ ctrLaFBxGvQBoa8LRLVCEqjbqdFmWuOHbI7lgIebbMQcqyQmMM2A1OzO0YTFNo+UL1Fy iyXPAmcHpAakboxiSzwAzLMDBE8nlUipV9uh02HB++WXhyJXX7h0fS1RhaSchaqjMP/r JbO7Smvi3eHV6fdw/+2KKlkAiCTiFt3DPI3YJhXb0sTNPlwsQWlE6qWqVmpnUGdm8wgF 6jBg== X-Forwarded-Encrypted: i=1; AFNElJ/kW0F2aHE88orhuPpO6f/JIPgQVK1XftRqoso3RfKnrqql3mVPqURf5O/BxLXqLdZ8eJtrfT55UCbr97M=@vger.kernel.org X-Gm-Message-State: AOJu0YwbcLwlOkmXuFJ4C+S3FSF8vnrn6oXrYL2k4HVlxznp+0KTNOyp FdMgn1km+eWfZpHMqFxwFL03/bZXd4D5iJbCjKxq0vcf644/OFgOIH+RJmkPn2al X-Gm-Gg: Acq92OHelVP/nwfsMOriNY0LQmCadOi045dlWO5cBfCd8IZrWlkmrTmLQsVWl6qdrUT t6teXHHdwXZ0YG22isjD8VUGFVaPBEZSndVj4kZqacVuoEkqSSqD1m9lC4Nk7LZqNZpFbHvaBXR A+E5oO1wA8BXuhhYSuHISFBHRGs6PcYIh5i4CNX8QfMMH++g2F7s7WTcgd7EiMfsd2ALJ28zOO9 rdTgJ0fkcXcrKSWUzVT2tEWvaD6uScMGH1Oe4Pe0p9+EaCkHkw1t0p3woXbuGpp/WQKx0V7k2Ui DNhMVnzH0wSMi+nk6LBC//bLdqzI7kByo36KYxh9c/UW0/WV/NbSic1iutoSOlBvS1VaQ7jXsN9 rIXC7lADTGmRk61uL42F0Nf0GParOSgtAz2Gq4urnNad5IUTlxgEwInY1+eWrTk7pv0fyA9WvSd ixdPEC6U8cvdibTn8Gt/Br4XSU2esKLWifATK72JhA7429madYOcJOErCir3x9rsRa8X4KUDM0p eE/RYQdrrhnw0lsUd23qbcdx416bVxziKM/dYtpeQFX7jVZAoVKp+KPm/YYSu03cg== X-Received: by 2002:a05:6808:1b26:b0:485:43af:5de0 with SMTP id 5614622812f47-485e73626eemr656910b6e.22.1780024761918; Thu, 28 May 2026 20:19:21 -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-7e695bb393bsm556788a34.7.2026.05.28.20.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 20:19:21 -0700 (PDT) From: Russ Fellows To: linux-fsdevel@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:19:14 +0000 Message-ID: <20260529031918.7361-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