From: "Bryn M. Reeves" <bmr-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Seymour, Shane M" <shane.seymour-VXdhtT5mjnY@public.gmane.org>
Cc: "linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Kai.Makisara-9Aww8k/80nUxHbG02/KK1g@public.gmane.org"
<Kai.Makisara-9Aww8k/80nUxHbG02/KK1g@public.gmane.org>,
"James E.J. Bottomley
(JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org)"
<JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>,
"Laurence Oberman
(loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org)"
<loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC] implementing tape statistics single file vs multi-file in sysfs
Date: Fri, 6 Feb 2015 09:13:55 +0000 [thread overview]
Message-ID: <20150206091354.GA1143@localhost.localdomain> (raw)
In-Reply-To: <DDB9C85B850785449757F9914A034FCB3BF3EADA-4I1V4pQFGigSZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
On Fri, Feb 06, 2015 at 12:20:53AM +0000, Seymour, Shane M wrote:
> There has been some ongoing discussion about the best way to implement
> tape statistics. The original method suggested a long time ago used a
> single file in sysfs similar to block statistics in sysfs. That lead to
> an impass about the code on the linux-scsi mailing list.
I would have a strong preference for a single file containing an array
of integer counters. This is in keeping with other statistics attributes
in sysfs and follows the principle of least surprise: it's essentially
the same general format as /proc/diskstats and sysfs disk and partition
stats (dm statistics also follow this convention via the @print_stats
message).
This simplifies userspace code to read and parse the counters and avoids
additional sample jitter when reading stats for very large numbers of
devices; each device would require at least eleven open()/read()/close()
cycles.
For a small number of devices this shouldn't matter too much but
eventually the additional syscall overhead could become significant (I
think you mentioned users with ~20k devices?).
The sync file mechanism in the v2 patch that addresses this problem is
kinda cute but also significantly more complex than a plain old array
and as you pointed out adds hundreds of lines to the patch..
Sticking to arrays also allows existing tools like sysstat to be easily
adapted to the new data source.
> The sysfs documentation says that files should contain one item per file (with some small exceptions):
>
> > "Attributes should be ASCII text files, preferably with only one value
> > per file. It is noted that it may not be efficient to contain only one
> > value per file, so it is socially acceptable to express an array of
> > values of the same type."
Right: I think there's good precedent for the array file style when
dealing with counter sets.
Regards,
Bryn.
next prev parent reply other threads:[~2015-02-06 9:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 0:20 [RFC] implementing tape statistics single file vs multi-file in sysfs Seymour, Shane M
[not found] ` <DDB9C85B850785449757F9914A034FCB3BF3EADA-4I1V4pQFGigSZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
2015-02-06 9:13 ` Bryn M. Reeves [this message]
[not found] ` <20150206091354.GA1143-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-02-06 13:01 ` Greg KH
2015-02-06 12:59 ` Greg KH
[not found] ` <20150206125916.GB26247-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-02-06 15:41 ` Bryn M. Reeves
2015-02-07 4:07 ` Greg KH
2015-02-08 2:27 ` Laurence Oberman
2015-02-08 2:45 ` Greg KH
2015-02-08 8:32 ` "Kai Mäkisara (Kolumbus)"
[not found] ` <20150208024506.GC15396-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-02-08 17:35 ` James Bottomley
[not found] ` <20150207040743.GB29944-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-02-10 14:27 ` Bryn M. Reeves
[not found] ` <20150210142719.GA1437-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-02-10 22:30 ` Greg KH
2015-02-11 11:32 ` Bryn M. Reeves
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=20150206091354.GA1143@localhost.localdomain \
--to=bmr-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
--cc=Kai.Makisara-9Aww8k/80nUxHbG02/KK1g@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=shane.seymour-VXdhtT5mjnY@public.gmane.org \
/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).