Re: [PATCH v2 1/3] 9p: Cache negative dentries for lookup performance
From: Christian Schoenebeck
Date: Mon Feb 23 2026 - 09:47:13 EST
On Saturday, 21 February 2026 21:35:52 CET Remi Pommarel wrote:
> On Thu, Feb 12, 2026 at 10:16:13AM +0100, Remi Pommarel wrote:
> > On Wed, Feb 11, 2026 at 04:49:19PM +0100, Christian Schoenebeck wrote:
> > > On Wednesday, 21 January 2026 20:56:08 CET Remi Pommarel wrote:
[...]
> > > > diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
> > > > index 6a12445d3858..99d1a0ff3368 100644
> > > > --- a/fs/9p/v9fs.h
> > > > +++ b/fs/9p/v9fs.h
> > > > @@ -91,6 +91,7 @@ enum p9_cache_bits {
> > > >
> > > > * @debug: debug level
> > > > * @afid: authentication handle
> > > > * @cache: cache mode of type &p9_cache_bits
> > > >
> > > > + * @ndentry_timeout: Negative dentry lookup cache retention time in
> > > > ms
> > > >
> > > > * @cachetag: the tag of the cache associated with this session
> > > > * @fscache: session cookie associated with FS-Cache
> > > > * @uname: string user name to mount hierarchy as
> > > >
> > > > @@ -116,6 +117,7 @@ struct v9fs_session_info {
> > > >
> > > > unsigned short debug;
> > > > unsigned int afid;
> > > > unsigned int cache;
> > > >
> > > > + unsigned int ndentry_timeout;
> > >
> > > Why not (signed) long?
> >
> > I first though 40+ days of cache retention was enough but that is just
> > an useless limitation, I will change it to signed long.
>
> Well now that I think about it, this is supposed to be set from a mount
> options. However, with the new mount API in use, there is currently no
> support for fsparam_long or fsparam_s64.
>
> While it could be implemented using a custom __fsparam, is the effort
> truly justified here? Also in that case maybe a long long would be a bit
> more portable across 32-bit and 64-bit platform?
Ah, there is fsparam_u64 but not fsparam_s64 and you are using -1 as option
for "infinite".
There is also `long session_lock_timeout´, but now that I look at it, its mount
option was apparently always limited to 32-bit, even before the new mount API
transition.
I agree, then just leave it as `int´ type now.
Thanks!
/Christian