From: Vito Caputo <vcaputo@pengaru.com>
To: Waiman Long <longman@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] fs/proc: introduce /proc/stat2 file
Date: Mon, 29 Oct 2018 15:41:58 -0700 [thread overview]
Message-ID: <20181029224158.xqbj3i4fbmbjexlh@shells.gnugeneration.com> (raw)
In-Reply-To: <492f93c1-e062-f699-8c8c-c2277fd3fbb0@redhat.com>
On Mon, Oct 29, 2018 at 05:35:15PM -0400, Waiman Long wrote:
> On 10/29/2018 05:23 PM, Vito Caputo wrote:
> > On Mon, Oct 29, 2018 at 04:59:03PM -0400, Waiman Long wrote:
> >> On 10/29/2018 04:38 PM, Davidlohr Bueso wrote:
> >>> On Mon, 29 Oct 2018, Waiman Long wrote:
> >>>
> >>>> BTW, since you are making stat2 compatible with stat, will that be
> >>>> easier from the user API perspective if we use a sysctl parameter to
> >>>> turn on and off IRQs reporting for /proc/stat, for example?
> >>> For one /proc/stat is also common for debugging envs (ie: performance)
> >>> and I fear that if a tunnable modifies the behavior of the output, we
> >>> it might never be usable again (at least not without having users also
> >>> now consider the systctl parameter). Making it dynamic I think is not
> >>> worth it.
> >>>
> >>> Thanks,
> >>> Davidlohr
> >> This is just a matter if it is easier for users to modify their code to
> >> use /proc/stat2 or turning on a sysctl parameter. Again, this will
> >> certainly depend on the circumstances.
> >>
> > I wonder if it makes sense to introduce a more general mechanism for
> > toggling subfields in proc files. Extended attributes could probably be
> > abused to key the subfields, write a 1 or 0 to well-known names for
> > toggling them on a per-fd basis via fsetxattr.
> >
> > For this particular case the program would just have to add code like:
> >
> > int zero = 0;
> > fsetxattr(proc_stat_fd, "intr", &zero, sizeof(zero), XATTR_REPLACE);
> >
> > Just putting it out there. I've certainly wanted an ability to noop
> > fields before where I was polling proc frequently and skipping the bulk
> > of what was there but syscpu was still rather high.
> >
> > I'm definitely not in favor of just adding another stat file that is the
> > same format as the existing one with the intrs zeroed out. It's a dirty
> > hack; fine for your local needs but too gross for upstream IMHO.
> >
> > Regards,
> > Vito Caputo
>
> Does procfs allow extended attributes? I am not sure if using extended
> attributes is a usual practice for doing this kind of control on a
> procfs file.
>
I'm not aware of any such usage, but I didn't dig into the code to see if
there were already conflicting xattr users.
If this did turn out to be a reasonable approach, it would probably be
wise to prefix the key strings with a namespace in case future uses come
up. Like "filter:intr" or something along those lines.
WRT procfs support for xattr, if it's not already implemented it's not
difficult to add. The important factor is this utilizes an existing vfs
api, there's nothing about procfs prohibiting xattr handling.
Regards,
Vito Caputo
next prev parent reply other threads:[~2018-10-29 22:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 19:25 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 [this message]
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
2018-11-08 2:07 ` Dave Chinner
2018-11-08 7:24 ` Davidlohr Bueso
2018-11-08 7:44 ` Davidlohr Bueso
2018-10-29 20:01 Alexey Dobriyan
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=20181029224158.xqbj3i4fbmbjexlh@shells.gnugeneration.com \
--to=vcaputo@pengaru.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@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
all inboxes | Powered by JetHome®