diff options
| author | Remi Pommarel <repk@triplefau.lt> | 2026-05-21 11:40:29 +0200 |
|---|---|---|
| committer | Dominique Martinet <asmadeus@codewreck.org> | 2026-06-21 05:22:56 +0000 |
| commit | f00e6c1d282578b077b87b88f42e701bc40f2fff (patch) | |
| tree | bfb721455665c346bfdcf19cc918f485cad6a5ab /include | |
| parent | 314b58c01a9047567fd19446ca5fd46c473b89ff (diff) | |
| download | ath-f00e6c1d282578b077b87b88f42e701bc40f2fff.tar.gz | |
9p: Cache negative dentries for lookup performance
Not caching negative dentries can result in poor performance for
workloads that repeatedly look up non-existent paths. Each such
lookup triggers a full 9P transaction with the server, adding
unnecessary overhead.
A typical example is source compilation, where multiple cc1 processes
are spawned and repeatedly search for the same missing header files
over and over again.
This change enables caching of negative dentries, so that lookups for
known non-existent paths do not require a full 9P transaction. The
cached negative dentries are retained for a configurable duration
(expressed in milliseconds), as specified by the ndentry_timeout
field in struct v9fs_session_info. If set to -1, negative dentries
are cached indefinitely.
This optimization reduces lookup overhead and improves performance for
workloads involving frequent access to non-existent paths.
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Message-ID: <e542317dd03bbadb5249abd3ea6aecfdca692c19.1779355927.git.repk@triplefau.lt>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/9p/client.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 838a94218b593..55c6cb54bd254 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -192,6 +192,7 @@ struct p9_rdma_opts { * @dfltgid: default numeric groupid to mount hierarchy as * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy * @session_lock_timeout: retry interval for blocking locks + * @ndentry_timeout_ms: Negative dentry lookup cache retention time in ms * * This strucure holds options which are parsed and will be transferred * to the v9fs_session_info structure when mounted, and therefore largely @@ -203,6 +204,7 @@ struct p9_session_opts { unsigned short debug; unsigned int afid; unsigned int cache; + unsigned int ndentry_timeout_ms; #ifdef CONFIG_9P_FSCACHE char *cachetag; #endif |
