From: Christian Schoenebeck <linux_oss@crudebyte.com>
To: v9fs@lists.linux.dev, Remi Pommarel <repk@triplefau.lt>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Eric Van Hensbergen <ericvh@kernel.org>,
Latchesar Ionkov <lucho@ionkov.net>,
Dominique Martinet <asmadeus@codewreck.org>,
Remi Pommarel <repk@triplefau.lt>
Subject: Re: [PATCH v7 0/4] 9p: Performance improvements for build workloads
Date: Fri, 18 Sep 2026 14:09:23 +0200 [thread overview]
Message-ID: <23246408.EfDdHjke4D@weasel> (raw)
In-Reply-To: <cover.1779355927.git.repk@triplefau.lt>
On Thursday, 21 May 2026 11:40:28 CEST Remi Pommarel wrote:
> This patchset introduces several performance optimizations for the 9p
> filesystem when used with cache=loose option (exclusive or read only
> mounts). These improvements particularly target workloads with frequent
> lookups of non-existent paths and repeated symlink resolutions.
>
> The very state of the art benchmark consisting of cloning a fresh
> hostap repository and building hostapd and wpa_supplicant for hwsim
> tests (cd tests/hwsim; time ./build.sh) in a VM running on a 9pfs rootfs
> (with trans=virtio,cache=loose options) has been used to test those
> optimizations impact.
>
> For reference, the build takes 0m56.492s on my laptop natively while it
> completes in 2m18.702sec on the VM. This represents a significant
> performance penalty considering running the same build on a VM using a
> virtiofs rootfs (with "--cache always" virtiofsd option) takes around
> 1m32.141s. This patchset aims to bring the 9pfs build time close to
> that of virtiofs, rather than the native host time, as a realistic
> expectation.
>
> This first three patches in this series focus on keeping negative
> dentries in the cache, ensuring that subsequent lookups for paths known
> to not exist do not require redundant 9P RPC calls. This optimization
> reduces the time needed for the compiler to search for header files
> across known locations. The two first patches introduce a new mount
> option, ndentrycache, which specifies the number of ms to keep the
> dentry in the cache. Using ndentrycache without value (i.e. keeping the
> negative dentry indifinetly) shrunk build time to 1m46.198s. The third
> patch enable the negative dentry caching for 24 hours by default on
> cache=loose.
>
> The fourth patch extends page cache usage to symlinks by allowing
> p9_client_readlink() results to be cached. Resolving symlink is
> apparently something done quite frequently during the build process and
> avoiding the cost of a 9P RPC call round trip for already known symlinks
> helps reduce the build time to 1m26.602s, outperforming the virtiofs
> setup.
>
> Here is summary of the different hostapd/wpa_supplicant build times:
>
> - Baseline (no patch): 2m18.702s
> - negative dentry caching (patches 1-3): 1m46.198s (23% improvement)
> - Above + symlink caching (patches 1-4): 1m26.302s (an additional 18%
> improvement, 37% in total)
>
> With this ~37% performance gain, 9pfs with cache=loose can compete with
> virtiofs for (at least) this specific scenario. Although this benchmark
> is not the most typical, I do think that these caching optimizations
> could benefit a wide range of other workflows as well.
Just for the records: this series has been merged via 1bc18858358d (Sun Jun 21
2026, merge tag '9p-for-7.2-rc1').
/Christian
prev parent reply other threads:[~2026-09-18 12:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 9:40 Remi Pommarel
2026-05-21 9:40 ` [PATCH v7 1/4] 9p: Cache negative dentries for lookup performance Remi Pommarel
2026-05-21 9:40 ` [PATCH v7 2/4] 9p: Add mount option for negative dentry cache retention Remi Pommarel
2026-05-21 9:40 ` [PATCH v7 3/4] 9p: Set default negative dentry retention time for cache=loose Remi Pommarel
2026-05-21 9:40 ` [PATCH v7 4/4] 9p: Enable symlink caching in page cache Remi Pommarel
2026-07-03 14:36 ` Dominique Martinet
2026-09-18 12:09 ` Christian Schoenebeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23246408.EfDdHjke4D@weasel \
--to=linux_oss@crudebyte.com \
--cc=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=repk@triplefau.lt \
--cc=v9fs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®