public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is sysfs the right place to get cache and CPU topology info?
@ 2008-07-02  6:27 Paul Mackerras
  2008-07-02  7:37 ` Andrew Morton
  0 siblings, 1 reply; 21+ messages in thread
From: Paul Mackerras @ 2008-07-02  6:27 UTC (permalink / raw)
  To: akpm, torvalds, linux-kernel, greg

I'm being asked by library developers about what is the best way for
them to get information about the CPU cache structure and the CPU
topology from the kernel.  When I said "x86 puts it in sysfs and we'll
do the same on powerpc" I got a response pointing me at this statement
in Documentation/sysfs-rules.txt (the first paragraph):

"The kernel-exported sysfs exports internal kernel implementation details
 and depends on internal kernel structures and layout. It is agreed upon
 by the kernel developers that the Linux kernel does not provide a stable
 internal API. As sysfs is a direct export of kernel internal
 structures, the sysfs interface cannot provide a stable interface either;
 it may always change along with internal kernel changes."

They read that to mean that sysfs is not a suitable interface for them
to use to get information about the system.  In particular they read
that to mean that if they do code their library to read sysfs, it will
change in the future in such a way as to break their code.

In other words, they see sysfs as being completely useless for them
because they can't depend on it as a stable interface.  Which is
reasonable given the quoted paragraph, but on the other hand, I don't
believe we break userspace interfaces as blithely as that paragraph
suggests.

So which is it?  Can they rely on the CPU cache and topology
information under /sys/devices/system/cpu/cpu*, and rely on having
that information there essentially forever?  Or are they correct in
saying sysfs is useless and we need to find some other way to expose
the cache and topology information?

Thanks,
Paul.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-07-04  1:16 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02  6:27 Is sysfs the right place to get cache and CPU topology info? Paul Mackerras
2008-07-02  7:37 ` Andrew Morton
2008-07-02  9:45   ` Paul Mackerras
2008-07-02 10:01     ` Andrew Morton
2008-07-02 11:46       ` Paul Mackerras
2008-07-02 16:47         ` Andrew Morton
2008-07-02 11:12   ` Andi Kleen
2008-07-02 14:35     ` Nathan Lynch
2008-07-02 15:14       ` Andi Kleen
2008-07-02 18:51         ` Greg KH
2008-07-02 21:41           ` Removing sysdevs? (was: Re: Is sysfs the right place to get cache and CPU topology info?) Rafael J. Wysocki
2008-07-02 21:48             ` Greg KH
2008-07-02 21:57               ` Removing sysdevs? Andi Kleen
2008-07-02 22:15                 ` Greg KH
2008-07-03  9:53                   ` Andi Kleen
2008-07-04  1:09                     ` Greg KH
2008-07-02 22:17                 ` Benjamin Herrenschmidt
2008-07-02 22:08               ` Removing sysdevs? (was: Re: Is sysfs the right place to get cache and CPU topology info?) Rafael J. Wysocki
2008-07-02 22:16                 ` Greg KH
2008-07-02 23:06                   ` Rafael J. Wysocki
2008-07-02 17:08   ` [PATCH] sysfs-rules.txt: reword API stability statement Nathan Lynch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox