Re: [LSF/MM TOPIC] Making pseudo file systems inodes/dentries more like normal file systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 25, 2024 at 09:40:07PM -0500, Steven Rostedt wrote:
> On Thu, 25 Jan 2024 17:59:40 -0800
> Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > > I tried to use kernfs when doing a lot of this and I had issues. I
> > > don't remember what those were, but I can revisit it.  
> > 
> > You might, as kernfs makes it so that the filesystem structures are
> > created on demand, when accessed, and then removed when memory pressure
> > happens.  That's what sysfs and configfs and cgroups use quite
> > successfully.
> 
> kernfs doesn't look trivial and I can't find any documentation on how
> to use it.

You have the code :)

> Should there be work to move debugfs over to kernfs?

Why?  Are you seeing real actual memory use with debugfs that is causing
problems?  That is why we made kernfs, because people were seeing this
in sysfs.

Don't change stuff unless you need to, right?

> I could look at it too, but as tracefs, and more specifically eventfs,
> has 10s of thousands of files, I'm very concerned about meta data size.

Do you have real numbers?  If not, then don't worry about it :)

> Currently eventfs keeps a data structure for every directory, but for
> the files, it only keeps an array of names and callbacks. When a
> directory is registered, it lists the files it needs. eventfs is
> specific that the number of files a directory has is always constant,
> and files will not be removed or added once a directory is created.
> 
> This way, the information on how a file is created is done via a
> callback that was registered when the directory was created.

That's fine, and shouldn't matter.

> For this use case, I don't think kernfs could be used. But I would
> still like to talk about what I'm trying to accomplish, and perhaps see
> if there's work that can be done to consolidate what is out there.

Again, look at kernfs if you care about the memory usage of your virtual
filesystem, that's what it is there for, you shouldn't have to reinvent
the wheel.

And the best part is, when people find issues with scaling or other
stuff with kernfs, your filesystem will then benifit (lots of tweaks
have gone into kernfs for this over the past few kernel releases.)

thanks,

greg k-h




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux