linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vito Caputo <vcaputo@pengaru.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Daniel Colascione <dancol@google.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	longman@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] fs/proc: introduce /proc/stat2 file
Date: Wed, 7 Nov 2018 12:32:39 -0800	[thread overview]
Message-ID: <20181107203239.nsbccdyckeeprjzr@shells.gnugeneration.com> (raw)
In-Reply-To: <CAJfpegsdFiM6QWt3VBEDvGdKHfvsvUnm06MC-ha7z_WPTP9znA@mail.gmail.com>

On Wed, Nov 07, 2018 at 11:03:06AM +0100, Miklos Szeredi wrote:
> On Wed, Nov 7, 2018 at 12:48 AM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Mon, 29 Oct 2018 23:04:45 +0000 Daniel Colascione <dancol@google.com> wrote:
> >
> >> On Mon, Oct 29, 2018 at 7:25 PM, Davidlohr Bueso <dave@stgolabs.net> wrote:
> >> > This patch introduces a new /proc/stat2 file that is identical to the
> >> > regular 'stat' except that it zeroes all hard irq statistics. The new
> >> > file is a drop in replacement to stat for users that need performance.
> >>
> >> For a while now, I've been thinking over ways to improve the
> >> performance of collecting various bits of kernel information. I don't
> >> think that a proliferation of special-purpose named bag-of-fields file
> >> variants is the right answer, because even if you add a few info-file
> >> variants, you're still left with a situation where a given file
> >> provides a particular caller with too little or too much information.
> >> I'd much rather move to a model in which userspace *explicitly* tells
> >> the kernel which fields it wants, with the kernel replying with just
> >> those particular fields, maybe in their raw binary representations.
> >> The ASCII-text bag-of-everything files would remain available for
> >> ad-hoc and non-performance critical use, but programs that cared about
> >> performance would have an efficient bypass. One concrete approach is
> >> to let users open up today's proc files and, instead of read(2)ing a
> >> text blob, use an ioctl to retrieve specified and targeted information
> >> of the sort that would normally be encoded in the text blob. Because
> >> callers would open the same file when using either the text or binary
> >> interfaces, little would have to change, and it'd be easy to implement
> >> fallbacks when a particular system doesn't support a particular
> >> fast-path ioctl.
> 
> Please.   Sysfs, with the one value per file rule, was created exactly
> for the purpose of eliminating these sort of problems with procfs.  So
> instead of inventing special purpose interfaces for proc, just make
> the info available in sysfs, if not already available.
> 

I like the sysfs approach to organizing the data, and have wanted
fd-batching IO syscalls in other circumstances anyways, so I think
there's a good possibility of something along those lines getting added
eventually.

At a past employer I had written some backup software which had to
reassemble versioned files from chains of reverse differentials (think
rdiff-backup).  I had all the information needed to quickly construct a
multi-fd iovec to supply to a single batched readv syscall when
servicing versioned reads from a FUSE mount that involved a potentially
long chain of diffs, but no such syscall exists.  The more
differentials, the more fragmented the operation tended to be, requiring
increasing numbers of smaller reads across more files to reconstruct the
buffer.

The same thing would be useful for making reads from large numbers of
sysfs files less costly.  I presume proposing such a generally
applicable VFS API addition would meet less resistance than specialized
proc interfaces, perhaps naively :).

Regards,
Vito Caputo

  parent reply	other threads:[~2018-11-07 20:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 19:25 [PATCH] fs/proc: introduce /proc/stat2 file Davidlohr Bueso
2018-10-29 19:35 ` Waiman Long
2018-10-29 20:00   ` Davidlohr Bueso
2018-10-29 20:29     ` Waiman Long
2018-10-29 20:38       ` Davidlohr Bueso
2018-10-29 20:59         ` Waiman Long
2018-10-29 21:23           ` Vito Caputo
2018-10-29 21:35             ` Waiman Long
2018-10-29 22:41               ` Vito Caputo
2018-10-30 18:57             ` Davidlohr Bueso
2018-10-30 22:40               ` Vito Caputo
2018-10-30 23:15                 ` Davidlohr Bueso
2018-10-29 21:01 ` Waiman Long
2018-10-29 23:04 ` Daniel Colascione
2018-10-30  0:58   ` Vito Caputo
2018-11-06 23:48   ` Andrew Morton
2018-11-07  3:32     ` Davidlohr Bueso
2018-11-07 16:31       ` Waiman Long
2018-11-07 10:03     ` Miklos Szeredi
2018-11-07 15:42       ` Daniel Colascione
2018-11-07 15:54         ` Miklos Szeredi
2018-11-07 16:01           ` Daniel Colascione
2018-11-07 20:32       ` Vito Caputo [this message]
2018-11-08  2:07       ` Dave Chinner
2018-11-08  7:24         ` Davidlohr Bueso
2018-11-08  7:44           ` Davidlohr Bueso

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=20181107203239.nsbccdyckeeprjzr@shells.gnugeneration.com \
    --to=vcaputo@pengaru.com \
    --cc=akpm@linux-foundation.org \
    --cc=dancol@google.com \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=miklos@szeredi.hu \
    /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).