From: Chris Metcalf <cmetcalf@tilera.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute
Date: Thu, 19 May 2011 11:12:13 -0400 [thread overview]
Message-ID: <4DD5334D.4060800@tilera.com> (raw)
In-Reply-To: <201105191541.11939.arnd@arndb.de>
On 5/19/2011 9:41 AM, Arnd Bergmann wrote:
> These all [below] look like ideal candidates for sysfs attributes under
> /sys/hypervisor, doing them one value per file, instead of grouping
> them into multiple entries per file.
>
> You can also turn each of these files into one directory under
> /sys/hypervisor, with one or more files under it.
>
> On Tuesday 17 May 2011, Chris Metcalf wrote
>> /proc/tile/hv
>> Version information about the running Tilera hypervisor
Yes, for "hv" this does make sense; I've coded it up. I had to add a
"select SYS_HYPERVISOR" for "config TILE" since otherwise tile doesn't
normally get a /sys/hypervisor directory. The upshot is
/sys/hypervisor/version and /sys/hypervisor/config_version files. The
"config_version" can be long (typically in the hundreds of characters) but
should rarely get up to the page size, and it's probably OK to just
truncate it in that case. It looks like Xen also tries to do things in
this directory, but we don't currently support Xen (we're working on KVM
instead) so I won't worry about it.
>> /proc/tile/hvconfig
>> Detailed configuration description of the hypervisor config
I'm concerned about moving this one out of /proc, since it's just (copious)
free text. An "hvconfig" (hypervisor config) file describes hypervisor
driver "dedicated tiles" that run things like network packet or PCIe
ingress/egress processing, etc. In addition it lists hypervisor driver
options, boot flags for the kernel, etc, all kinds of things -- and you
can't really guarantee that it will fit on a 4KB page, though in practice
it usually does. The hypervisor reads this file from the boot stream when
it boots, and then makes it available to Linux not for Linux's use, or even
for programmatic userspace use, but just for end users to be able to review
and verify that the configuration they think they booted is really what
they got, for customer remote debugging, etc. The "remote debugging"
aspect makes truncation to page size a particularly worrisome idea.
>> /proc/tile/board
>> Information on part numbers, serial numbers, etc., of the
>> hardware that the kernel is executing on
>>
>> /proc/tile/switch
>> The type of control path for the onboard network switch, if any.
These two report information about the hardware, not the hypervisor. For
example:
# cat /proc/tile/board
board_part: 402-00002-05
board_serial: NBS-5002-00012
chip_serial: P62338.01.110
chip_revision: A0
board_revision: 2.2
board_description: Tilera TILExpressPro-64, TILEPro64 processor (866 MHz-capable), 1 10GbE, 6 1GbE
# cat /proc/tile/switch
control: mdio gbe/0
The chip_serial and chip_revision can certainly hang off
/sys/devices/system/cpu along with chip_height and chip_width (I've made
this change now) but I don't know where the remaining "board" level
description could go. Note that (as you can see in the source) certain
boards will also include four lines of output with the "mezzanine board"
part number, serial number, revision, and description; this particular
example doesn't have a mezzanine board. The "switch" info is broken out
into a separate file just to make it easier to script some /etc/rc code
that launches a configurator for the Marvell switch on some of our boards,
but is conceptually part of the board info.
>> /proc/tile/hardwall
>> Information on the set of currently active hardwalls (note that
>> the implementation is already present in arch/tile/kernel/hardwall.c;
>> this change just enables it)
This one is not a hypervisor-related file. It just lists information about
the set of Linux hardwalls currently active. Again, it's not primarily
intended for programmatic use, but as a diagnostic tool.
>> diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
>> new file mode 100644
>> index 0000000..151deeb
>> --- /dev/null
>> +++ b/arch/tile/kernel/sysfs.c
>> [...]
>> +static int __init create_cpu_entries(void)
>> +{
>> + struct sysdev_class *cls = &cpu_sysdev_class;
>> + int err = 0;
>> +
>> + if (!err)
>> + err = sysfs_create_file(&cls->kset.kobj,
>> + &attr_chip_width.attr);
>> + if (!err)
>> + err = sysfs_create_file(&cls->kset.kobj,
>> + &attr_chip_height.attr);
>> +
>> + return err;
>> +}
> This should use sysdev_create_file instead of open-coding it.
My impression was that I had to associate my new attributes to the
sysdev_class corresponding to "/sys/devices/system/cpu/", since I'm
registering these as top-level items in the cpu directory, e.g.
/sys/devices/system/cpu/chip_width; they are not properties of individual
cpus. It doesn't appear that there is a sys_device corresponding to where
I want to register them.
As always, thanks, Arnd!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
next prev parent reply other threads:[~2011-05-19 15:12 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 5:43 [PATCH] arch/tile: new multi-core architecture for Linux Chris Metcalf
2010-05-20 8:04 ` Barry Song
2010-05-20 14:32 ` Linus Torvalds
2010-05-20 19:10 ` Chris Metcalf
2010-05-21 4:52 ` Barry Song
2010-05-21 15:13 ` Chris Metcalf
2010-05-20 19:12 ` [PATCH] generic: make lowmem_page_address() use PFN_PHYS() for improved portability Chris Metcalf
2010-05-22 4:05 ` [PATCH] arch/tile: new multi-core architecture for Linux Chris Metcalf
2010-05-23 22:08 ` Arnd Bergmann
2010-05-24 15:29 ` Chris Metcalf
2010-05-24 18:53 ` Arnd Bergmann
2010-05-24 21:29 ` Chris Metcalf
2010-05-25 13:54 ` Chris Metcalf
2010-05-25 15:03 ` Arnd Bergmann
2010-05-25 15:13 ` Chris Metcalf
2010-05-25 15:30 ` Arnd Bergmann
2010-05-26 2:44 ` liqin.chen
2010-05-26 13:45 ` Chris Metcalf
[not found] ` <4BFBE005.2070500@tilera.com>
[not found] ` <201005251721.23782.arnd@arndb.de>
2010-05-26 23:05 ` Chris Metcalf
2010-05-26 5:02 ` Paul Mundt
2010-05-25 21:45 ` Arnd Bergmann
2010-05-27 0:58 ` Chris Metcalf
2010-05-27 8:41 ` Arnd Bergmann
2010-05-27 13:30 ` Chris Metcalf
2010-05-27 13:41 ` Geert Uytterhoeven
2010-05-27 13:48 ` Paul Mundt
2010-05-27 14:11 ` Arnd Bergmann
2010-05-27 14:35 ` Chris Metcalf
2010-05-27 15:02 ` Arnd Bergmann
2010-05-27 15:04 ` Chris Metcalf
2010-05-27 15:20 ` Arnd Bergmann
2010-05-27 14:52 ` Marc Gauthier
2010-05-28 17:58 ` Chris Metcalf
2010-05-27 15:03 ` Chris Metcalf
2010-05-27 20:34 ` Jamie Lokier
2010-05-27 20:53 ` Arnd Bergmann
2010-05-28 16:45 ` Chris Metcalf
2010-05-28 17:16 ` Arnd Bergmann
2010-05-28 17:28 ` Chris Metcalf
2011-05-16 18:23 ` [PATCH] arch/tile: support signal "exception-trace" hook Chris Metcalf
2011-05-18 18:14 ` Chris Metcalf
2011-05-17 20:26 ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Chris Metcalf
2011-05-19 13:41 ` Arnd Bergmann
2011-05-19 15:12 ` Chris Metcalf [this message]
2011-05-19 15:22 ` Arnd Bergmann
2011-05-20 14:26 ` Chris Metcalf
2011-05-20 14:37 ` Arnd Bergmann
2011-05-20 15:00 ` Chris Metcalf
2011-05-20 15:13 ` Arnd Bergmann
2011-05-20 19:59 ` Arnd Bergmann
2011-05-25 19:18 ` Chris Metcalf
2011-05-25 20:20 ` Arnd Bergmann
2011-05-25 20:31 ` Chris Metcalf
2011-05-25 20:34 ` Arnd Bergmann
2011-05-24 15:38 ` Arnd Bergmann
2011-05-26 16:40 ` [PATCH v2] arch/tile: more /proc and /sys file support Chris Metcalf
2011-05-27 14:23 ` Arnd Bergmann
2010-05-24 20:22 ` [PATCH] arch/tile: new multi-core architecture for Linux Sam Ravnborg
2010-05-24 21:30 ` Chris Metcalf
2010-05-25 5:02 ` Sam Ravnborg
2010-05-25 20:12 ` Thomas Gleixner
2010-05-26 1:57 ` Chris Metcalf
2010-05-26 16:22 ` Chris Metcalf
2010-05-26 17:09 ` Arnd Bergmann
2010-05-29 3:01 ` [PATCH 1/8] Fix up the "generic" unistd.h ABI to be more useful Chris Metcalf
2010-05-29 3:09 ` [PATCH 2/8] arch/tile: infrastructure and configuration-related files Chris Metcalf
2010-05-31 7:47 ` Paul Mundt
2010-06-03 17:54 ` Chris Metcalf
2010-05-29 3:10 ` [PATCH 3/8] arch/tile: header files for the Tile architecture Chris Metcalf
2010-05-31 2:58 ` FUJITA Tomonori
2010-06-03 21:32 ` [PATCH] arch/tile: respond to reviews of the second code submission Chris Metcalf
2010-06-04 0:50 ` Paul Mundt
2010-06-04 1:31 ` FUJITA Tomonori
2010-06-07 5:25 ` FUJITA Tomonori
2010-05-29 3:10 ` [PATCH 4/8] arch/tile: core kernel/ code Chris Metcalf
2010-05-31 2:58 ` FUJITA Tomonori
2010-05-29 3:11 ` [PATCH 5/8] arch/tile: the kernel/tile-desc_32.c file Chris Metcalf
2010-05-29 3:13 ` [PATCH 6/8] arch/tile: the mm/ directory Chris Metcalf
2010-05-29 3:16 ` [PATCH 7/8] arch/tile: lib/ directory Chris Metcalf
2010-05-29 3:17 ` [PATCH 8/8] arch/tile: hypervisor console driver Chris Metcalf
[not found] ` <dVZMmBu$KHA.5388@exchange1.tad.internal.tilera.com>
2010-05-29 3:20 ` [PATCH 0/8] revised patch for arch/tile/ support Chris Metcalf
2010-05-29 3:20 ` Chris Metcalf
2010-05-29 11:29 ` Arnd Bergmann
2010-06-03 20:40 ` Arnd Bergmann
2010-06-03 21:48 ` Chris Metcalf
2010-06-04 21:32 ` Chris Metcalf
2010-06-05 12:56 ` Stephen Rothwell
2010-06-05 13:30 ` Chris Metcalf
2010-06-05 14:10 ` Stephen Rothwell
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=4DD5334D.4060800@tilera.com \
--to=cmetcalf@tilera.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.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