From: Chris Metcalf <cmetcalf@tilera.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute
Date: Wed, 25 May 2011 15:17:09 -0400 [thread overview]
Message-ID: <4DDD55B5.6000804@tilera.com> (raw)
In-Reply-To: <201105202159.50780.arnd@arndb.de>
[-- Attachment #1.1: Type: text/plain, Size: 2936 bytes --]
(Resending after marking LKML in my Thunderbird address book for "no HTML".)
On 5/20/2011 3:59 PM, Arnd Bergmann wrote:
> Any chance you can still restructure the information? I would recommend
> making it a first-class procfs member, since the data is really per-task.
>
> You can add a conditional entry to tgid_base_stuff[] in fs/proc/base.c
> to make it show up for each pid, and then just have the per-task information
> in there to do the lookup the other way round:
>
> # cat /proc/484/hardwall
> 2x2 1,1 @2,1
>
> # cat /proc/479/hardwall
> 2x2 1,1 @1,1
> Another problem with the existing interface is that it doesn't currently
> support PID name spaces. That could of course be retrofitted, but having
> the data split by pid directory would make it work implicitly.
>
> Another approach would be to have a /proc/hardwall/ directory with
> one entry per hardwall instance, and symlinks from /proc/<pid>/hardwall
> to the respective file.
I went ahead and implemented this, and will send out a v2 patch shortly. I
added the "hardwall" entry to both the tgid_base (since everything is
reflected there) but also to the tid_base_stuff[], since it can be
different (in principle) for different threads.
I played around with using a symlink, but the bottom line seems to be that
if I make it a symlink (via a SYM() macro in the table) it always has to
exist -- so what does it point to when there's no hardwall activated? I
tried making it point to /dev/null, but that just seemed silly. In the end
I made /proc/PID/hardwall a file, either empty, or else containing the
hardwall id.
The actual hardwalls are then in /proc/tile/hardwall/NN, where NN is the
hardwall id. I wrote a very simple hardwall id allocate/free pair; the pid
allocator seemed too tied to task_structs. We only need at most NR_CPUS
hardwall ids, so it's pretty simple to just use a cpumask to hold the set
of allocated hardwall IDs.
The contents of the hardwall ID file are then just a cpulist of the cpus
covered by the hardwall, rather than introducing a new convention (as
quoted above, e.g. "2x2 1,1"). Individual tasks that are in the hardwall
can be found by reading the "hardwall" files, and we can learn where they
are bound in the hardwall by reading the "stat" file as is normal for
learning process affinity.
> When you do a /sys/hypervisor/ interface, put everything into a subdirectory
> under /sys/hypervisor with the name of your hypervisor, to avoid naming
> conflicts, e.g.
>
> /sys/hypervisor/tilera-hv/board/board_serial
I don't see an easy way to put a directory in /sys/hypervisor. It seems
complex to create a kobject and a suitable class, etc., just for a
subdirectory. Or is there something simple I'm missing? I'll keep looking.
I also suspect just "tile" is an adequate subdirectory name here in the
context of /sys/hypervisor, e.g. /sys/hypervisor/tile/version.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
[-- Attachment #1.2: Type: text/html, Size: 3815 bytes --]
[-- Attachment #2: Type: text/plain, Size: 184 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2011-05-25 19:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201105181807.p4II7C5g015224@farm-0002.internal.tilera.com>
[not found] ` <201105191541.11939.arnd@arndb.de>
[not found] ` <4DD5334D.4060800@tilera.com>
2011-05-19 15:22 ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Arnd Bergmann
[not found] ` <201105191722.17685.arnd@arndb.de>
2011-05-20 14:26 ` Chris Metcalf
[not found] ` <4DD67A31.90802@tilera.com>
2011-05-20 14:37 ` Arnd Bergmann
[not found] ` <201105201637.20925.arnd@arndb.de>
2011-05-20 15:00 ` Chris Metcalf
[not found] ` <4DD6821F.6060707@tilera.com>
2011-05-20 15:13 ` Arnd Bergmann
[not found] ` <201105201713.25364.arnd@arndb.de>
2011-05-20 19:59 ` Arnd Bergmann
[not found] ` <201105202159.50780.arnd@arndb.de>
2011-05-25 19:09 ` Chris Metcalf
2011-05-25 19:17 ` Chris Metcalf [this message]
2011-05-25 19:18 ` Chris Metcalf
[not found] ` <4DDD55ED.2080607@tilera.com>
2011-05-25 20:20 ` Arnd Bergmann
[not found] ` <201105252220.23948.arnd@arndb.de>
2011-05-25 20:31 ` Chris Metcalf
[not found] ` <4DDD6729.7070201@tilera.com>
2011-05-25 20:34 ` Arnd Bergmann
[not found] ` <201105261648.p4QGmNKf001636@farm-0023.internal.tilera.com>
2011-05-27 14:23 ` [PATCH v2] arch/tile: more /proc and /sys file support Arnd Bergmann
2011-05-24 15:38 ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Arnd Bergmann
2011-05-26 16:40 ` [PATCH v2] arch/tile: more /proc and /sys file support Chris Metcalf
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=4DDD55B5.6000804@tilera.com \
--to=cmetcalf@tilera.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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