public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Reaver <me@davidreaver.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,  Tejun Heo <tj@kernel.org>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	 Christoph Hellwig <hch@infradead.org>,
	 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, 03 Feb 2025 08:12:50 -0800	[thread overview]
Message-ID: <86bjvjdn25.fsf@davidreaver.com> (raw)
In-Reply-To: <2025020304-mango-preheated-1560@gregkh> (Greg Kroah-Hartman's message of "Mon, 3 Feb 2025 16:05:17 +0100")

Greg Kroah-Hartman <gregkh@linuxfoundation.org> 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

      reply	other threads:[~2025-02-03 16:12 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
2025-02-03 16:12                   ` David Reaver [this message]

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=86bjvjdn25.fsf@davidreaver.com \
    --to=me@davidreaver.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=kjlx@templeofstupid.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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