From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Tejun Heo <tj@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
David Reaver <me@davidreaver.com>,
Christian Brauner <brauner@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Jonathan Corbet <corbet@lwn.net>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Krister Johansen <kjlx@templeofstupid.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 0/5] samples/kernfs: Add a pseudo-filesystem to demonstrate kernfs usage
Date: Mon, 3 Feb 2025 16:05:17 +0100 [thread overview]
Message-ID: <2025020304-mango-preheated-1560@gregkh> (raw)
In-Reply-To: <20250128190224.635a9562@gandalf.local.home>
On Tue, Jan 28, 2025 at 07:02:24PM -0500, Steven Rostedt wrote:
> On Tue, 28 Jan 2025 13:38:42 -1000
> Tejun Heo <tj@kernel.org> wrote:
>
> > On Tue, Jan 28, 2025 at 06:29:57PM -0500, Steven Rostedt wrote:
> > > What I did for eventfs, and what I believe kernfs does, is to create a
> > > small descriptor to represent the control data and reference them like what
> > > you would have on disk. That is, the control elements (like an trace event
> > > descriptor) is really what is on "disk". When someone does an "ls" to the
> > > pseudo file system, there needs to be a way for the VFS layer to query the
> > > control structures like how a normal file system would query that data
> > > stored on disk, and then let the VFS layer create the dentry and inodes
> > > when referenced, and more importantly, free them when they are no longer
> > > referenced and there's memory pressure.
> >
> > Yeap, that's exactly what kernfs does.
>
> 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
next prev parent reply other threads:[~2025-02-03 15:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 15:36 [PATCH 0/5] samples/kernfs: Add a pseudo-filesystem to demonstrate kernfs usage David Reaver
2025-01-21 15:46 ` [PATCH 1/5] samples/kernfs: Adds boilerplate/README for sample_kernfs David Reaver
2025-01-21 15:46 ` [PATCH 2/5] samples/kernfs: Make filesystem mountable David Reaver
2025-01-21 15:46 ` [PATCH 3/5] samples/kernfs: Add counter file to each directory David Reaver
2025-01-21 15:47 ` [PATCH 4/5] samples/kernfs: Allow creating and removing directories David Reaver
2025-01-21 15:47 ` [PATCH 5/5] samples/kernfs: Add inc file to allow changing counter increment David Reaver
2025-01-28 6:08 ` [PATCH 0/5] samples/kernfs: Add a pseudo-filesystem to demonstrate kernfs usage Christoph Hellwig
2025-01-28 15:27 ` Steven Rostedt
2025-01-28 22:05 ` Linus Torvalds
2025-01-28 22:42 ` Steven Rostedt
2025-01-28 22:51 ` Tejun Heo
2025-01-28 23:29 ` Steven Rostedt
2025-01-28 23:38 ` Tejun Heo
2025-01-29 0:02 ` Steven Rostedt
2025-02-03 15:05 ` Greg Kroah-Hartman [this message]
2025-02-03 16:12 ` David Reaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025020304-mango-preheated-1560@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--cc=hch@infradead.org \
--cc=kjlx@templeofstupid.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=me@davidreaver.com \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox