* [RFC] use of /sys versus /proc
@ 2008-05-23 13:12 Cliff Wickman
2008-05-23 17:19 ` Valdis.Kletnieks
2008-05-23 20:47 ` Alexey Dobriyan
0 siblings, 2 replies; 5+ messages in thread
From: Cliff Wickman @ 2008-05-23 13:12 UTC (permalink / raw)
To: linux-kernel
I have a need to display TLB shootdown statistics. (I'm working
on a patch to implement this on a new machine at SGI.)
I had planned to display these statistics through /proc
as in arch/ia64/sn/kernel/sn2/sn2_smp.c (/proc/sgi_sn/ptc_statistics).
However, considering the general move to reserve /proc for
process-related things, I thought the community might prefer the
interface to be in /sys.
But sysfs has an output buffer restriction of one page, which
is too restrictive for statistics from very large cpu counts.
We intend to display about 10 numbers per cpu.
Besides, the spirit of /sys according to the sysfs.txt documentation:
"Attributes should be ... preferably with only one value
per file. ... acceptable to express an array of values of the same type."
[it also warns:
"... expressing multiple lines of data, ... is heavily frowned upon.
Doing these things may get you publically humiliated and your code
rewritten without notice."]
If I break up the statistics files per-cpu, or maybe ranges of
cpu's, it would create a potentially large number of files in /sys.
Or, I could stick with a single file in /proc.
What would you recommend?
Thanks.
-Cliff Wickman
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] use of /sys versus /proc
2008-05-23 13:12 [RFC] use of /sys versus /proc Cliff Wickman
@ 2008-05-23 17:19 ` Valdis.Kletnieks
2008-05-23 20:48 ` Cliff Wickman
2008-05-23 20:47 ` Alexey Dobriyan
1 sibling, 1 reply; 5+ messages in thread
From: Valdis.Kletnieks @ 2008-05-23 17:19 UTC (permalink / raw)
To: Cliff Wickman; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
On Fri, 23 May 2008 08:12:55 CDT, Cliff Wickman said:
>
> I have a need to display TLB shootdown statistics. (I'm working
> on a patch to implement this on a new machine at SGI.)
>
> I had planned to display these statistics through /proc
> as in arch/ia64/sn/kernel/sn2/sn2_smp.c (/proc/sgi_sn/ptc_statistics).
>
> However, considering the general move to reserve /proc for
> process-related things, I thought the community might prefer the
> interface to be in /sys.
Is debugfs an option?
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] use of /sys versus /proc
2008-05-23 20:47 ` Alexey Dobriyan
@ 2008-05-23 20:08 ` Robin Holt
0 siblings, 0 replies; 5+ messages in thread
From: Robin Holt @ 2008-05-23 20:08 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: Cliff Wickman, linux-kernel
On Sat, May 24, 2008 at 12:47:39AM +0400, Alexey Dobriyan wrote:
> On Fri, May 23, 2008 at 08:12:55AM -0500, Cliff Wickman wrote:
> > I have a need to display TLB shootdown statistics. (I'm working
> > on a patch to implement this on a new machine at SGI.)
> >
> > I had planned to display these statistics through /proc
> > as in arch/ia64/sn/kernel/sn2/sn2_smp.c (/proc/sgi_sn/ptc_statistics).
> >
> > However, considering the general move to reserve /proc for
> > process-related things, I thought the community might prefer the
> > interface to be in /sys.
> >
> > But sysfs has an output buffer restriction of one page, which
> > is too restrictive for statistics from very large cpu counts.
> > We intend to display about 10 numbers per cpu.
> >
> > Besides, the spirit of /sys according to the sysfs.txt documentation:
> > "Attributes should be ... preferably with only one value
> > per file. ... acceptable to express an array of values of the same type."
> > [it also warns:
> > "... expressing multiple lines of data, ... is heavily frowned upon.
> > Doing these things may get you publically humiliated and your code
> > rewritten without notice."]
> >
> > If I break up the statistics files per-cpu, or maybe ranges of
> > cpu's, it would create a potentially large number of files in /sys.
> >
> > Or, I could stick with a single file in /proc.
> >
> > What would you recommend?
>
> TLB shootdowns are in /proc/interrupts at least on x86_64.
This is a different engine for our UV platform. Due to the large number
of nodes with many cpus that may need to be invalidated, we have a
special piece of hardware that assists in broadcasts. Cliff's upcoming
patch will introduce that. He has written the driver with some built-in
statistics about the use of that hardware.
Thanks,
Robin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] use of /sys versus /proc
2008-05-23 13:12 [RFC] use of /sys versus /proc Cliff Wickman
2008-05-23 17:19 ` Valdis.Kletnieks
@ 2008-05-23 20:47 ` Alexey Dobriyan
2008-05-23 20:08 ` Robin Holt
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2008-05-23 20:47 UTC (permalink / raw)
To: Cliff Wickman; +Cc: linux-kernel
On Fri, May 23, 2008 at 08:12:55AM -0500, Cliff Wickman wrote:
> I have a need to display TLB shootdown statistics. (I'm working
> on a patch to implement this on a new machine at SGI.)
>
> I had planned to display these statistics through /proc
> as in arch/ia64/sn/kernel/sn2/sn2_smp.c (/proc/sgi_sn/ptc_statistics).
>
> However, considering the general move to reserve /proc for
> process-related things, I thought the community might prefer the
> interface to be in /sys.
>
> But sysfs has an output buffer restriction of one page, which
> is too restrictive for statistics from very large cpu counts.
> We intend to display about 10 numbers per cpu.
>
> Besides, the spirit of /sys according to the sysfs.txt documentation:
> "Attributes should be ... preferably with only one value
> per file. ... acceptable to express an array of values of the same type."
> [it also warns:
> "... expressing multiple lines of data, ... is heavily frowned upon.
> Doing these things may get you publically humiliated and your code
> rewritten without notice."]
>
> If I break up the statistics files per-cpu, or maybe ranges of
> cpu's, it would create a potentially large number of files in /sys.
>
> Or, I could stick with a single file in /proc.
>
> What would you recommend?
TLB shootdowns are in /proc/interrupts at least on x86_64.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] use of /sys versus /proc
2008-05-23 17:19 ` Valdis.Kletnieks
@ 2008-05-23 20:48 ` Cliff Wickman
0 siblings, 0 replies; 5+ messages in thread
From: Cliff Wickman @ 2008-05-23 20:48 UTC (permalink / raw)
To: Valdis.Kletnieks; +Cc: linux-kernel
On Fri, May 23, 2008 at 01:19:20PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 23 May 2008 08:12:55 CDT, Cliff Wickman said:
> >
> > I have a need to display TLB shootdown statistics. (I'm working
> > on a patch to implement this on a new machine at SGI.)
> >
> > I had planned to display these statistics through /proc
> > as in arch/ia64/sn/kernel/sn2/sn2_smp.c (/proc/sgi_sn/ptc_statistics).
> >
> > However, considering the general move to reserve /proc for
> > process-related things, I thought the community might prefer the
> > interface to be in /sys.
>
> Is debugfs an option?
I tried that out and it works about like /proc, which is good.
It doesn't clutter /proc.
Plus it can disappear gracefully from the kernel if CONFIG_DEBUG_FS
is set off. (it is set on in the default x86_64 configuration)
So thanks for the suggestion. It may be the answer.
--
Cliff Wickman
Silicon Graphics, Inc.
cpw@sgi.com
(651) 683-3824
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-23 20:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-23 13:12 [RFC] use of /sys versus /proc Cliff Wickman
2008-05-23 17:19 ` Valdis.Kletnieks
2008-05-23 20:48 ` Cliff Wickman
2008-05-23 20:47 ` Alexey Dobriyan
2008-05-23 20:08 ` Robin Holt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox