linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Brian Masney <masneyb@onstation.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	pbonzini@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: "statsfs" API design
Date: Sun, 10 Nov 2019 11:19:33 +0100	[thread overview]
Message-ID: <20191110101933.GA1442498@kroah.com> (raw)
In-Reply-To: <20191110101418.GA1441328@kroah.com>

On Sun, Nov 10, 2019 at 11:14:18AM +0100, Greg KH wrote:
> On Sun, Nov 10, 2019 at 05:09:13AM -0500, Brian Masney wrote:
> > On Sun, Nov 10, 2019 at 10:14:35AM +0100, Greg KH wrote:
> > > On Sat, Nov 09, 2019 at 09:44:41PM +0300, Alexey Dobriyan wrote:
> > > > > statsfs is a proposal for a new Linux kernel synthetic filesystem,
> > > > > to be mounted in /sys/kernel/stats
> > > > 
> > > > I think /proc experiment teaches pretty convincingly that dressing
> > > > things into a filesystem can be done but ultimately is a stupid idea.
> > > > It adds so much overhead for small-to-medium systems.
> > > > 
> > > > > The first user of statsfs would be KVM, which is currently exposing
> > > > > its stats in debugfs
> > > > 
> > > > > Google has KVM patches to gather statistics in a binary format
> > > > 
> > > > Which is a right thing to do.
> > > 
> > > It's always "simpler" to just take binary data and suck it in.  That
> > > works for a year or so until another value needs to be supported.  Or
> > > removed.  Or features are backported.
> > > 
> > > The reason text values in individual files work is they are "self
> > > describable" and "self discoverable".  You "know" what the value is and
> > > that it is supported because the file is there or not.  With binary
> > > values in a single file you do not know any of that.
> > > 
> > > So you need some way of describing the data to userspace in order for
> > > this to work properly over the next 20+ years.
> > > 
> > > Maybe something like varlink which describes the data coming from the
> > > kernel in an easy-to-handle format?  Or something else, but just using
> > > blobs does not work over the long-term, sorry.
> > 
> > What about using a text format like YAML? Here's some benefits:
> > 
> >   - The fields are self describing based on the key name.
> >   - New fields can be easily added without breaking compatibility.
> >   - Allows for a script to easily parse the contents while keeping
> >     human readability.
> >   - Would work for systems that run busybox as their userspace without
> >     having to install additional tools.
> >   - Allows for a nested data structure.
> 
> varlink was created to solve the issues that people have had with YAML
> over time, so you might want to look into that :)
> 	https://varlink.org/

Well, varlink really is JSON, but at least there's example code for
userspace and kernelspace to pull from to knock up tests for people who
want to look into it.

thanks,

greg k-h

  reply	other threads:[~2019-11-10 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 18:44 "statsfs" API design Alexey Dobriyan
2019-11-10  9:14 ` Greg KH
2019-11-10 10:09   ` Brian Masney
2019-11-10 10:14     ` Greg KH
2019-11-10 10:19       ` Greg KH [this message]
2019-11-10 15:34   ` Alexey Dobriyan
2019-11-10 20:58     ` Paolo Bonzini
2019-11-11 20:40       ` Alexey Dobriyan
2019-11-26 10:07         ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2019-11-06 15:56 Paolo Bonzini
2019-11-09 15:49 ` Greg Kroah-Hartman
2019-11-10 13:04   ` Paolo Bonzini
2019-11-26 10:09     ` Greg Kroah-Hartman
2019-11-26 10:50       ` Paolo Bonzini
2019-11-26 14:18         ` Greg Kroah-Hartman

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=20191110101933.GA1442498@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=pbonzini@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).