Re: [PATCH v3 2/4] kernfs: use VFS negative dentry caching

2021-04-09 Thread Ian Kent
On Fri, 2021-04-09 at 16:26 +0800, Ian Kent wrote: > On Fri, 2021-04-09 at 01:35 +, Al Viro wrote: > > On Fri, Apr 09, 2021 at 09:15:06AM +0800, Ian Kent wrote: > > > + parent = kernfs_dentry_node(dentry->d_parent); > > > + if (parent) { > > > + const void *ns =

Re: [PATCH v3 2/4] kernfs: use VFS negative dentry caching

2021-04-09 Thread Ian Kent
On Fri, 2021-04-09 at 01:35 +, Al Viro wrote: > On Fri, Apr 09, 2021 at 09:15:06AM +0800, Ian Kent wrote: > > + parent = kernfs_dentry_node(dentry->d_parent); > > + if (parent) { > > + const void *ns = NULL; > > + > > + if (kernfs_ns_enabl

Re: [PATCH v3 2/4] kernfs: use VFS negative dentry caching

2021-04-08 Thread Al Viro
On Fri, Apr 09, 2021 at 09:15:06AM +0800, Ian Kent wrote: > + parent = kernfs_dentry_node(dentry->d_parent); > + if (parent) { > + const void *ns = NULL; > + > + if (kernfs_ns_enabled(parent)) > + ns = kernf

[PATCH v3 2/4] kernfs: use VFS negative dentry caching

2021-04-08 Thread Ian Kent
If there are many lookups for non-existent paths these negative lookups can lead to a lot of overhead during path walks. The VFS allows dentries to be created as negative and hashed, and caches them so they can be used to reduce the fairly high overhead alloc/free cycle that occurs during these lo