Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes: > On Tue, Jan 28, 2025 at 07:02:24PM -0500, Steven Rostedt wrote: >> >> And eventfs goes one step further. Because there's a full directory layout >> that's identical for every event, it has a single descriptor for directory >> and not for file. As there can be over 10 files per directory/event I >> didn't want to waste even that memory. This is why I couldn't use kernfs >> for eventfs, as I was able to still save a couple of megabytes by not >> having the files have any descriptor representing them (besides a single >> array for all events). > > Ok, that's fine, but the original point of "are you sure you want to use > kernfs for anything other than what we have today" remains. It's only a > limited set of use cases that kernfs is good for, libfs is still the > best place to start out for a virtual filesystem. The fact that the > majority of our "fake" filesystems are using libfs and not kernfs is > semi-proof of that? > > Or is it proof that kernfs is just too undocumented that no one wants to > move to it? I don't know, but adding samples like this really isn't the > answer to that, the answer would be moving an existing libfs > implementation to use kernfs and then that patch series would be the > example to follow for others. > > thanks, > > greg k-h Thanks for reviewing the patch, Greg! I put this sample together with the idea that some documentation is better than none. I researched how kernfs could be useful in tracefs and debugfs, but I haven't looked deeply into other virtual filesystems, so I may have overestimated how well kernfs fits other use cases. From this discussion, I see that a real libfs-to-kernfs port would provide a better understanding of kernfs' viability elsewhere and also serve as documentation. Thanks for the discussion, folks! I learned a lot from this thread. Thanks, David Reaver