All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: virtualization@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Chris Metcalf <cmetcalf@tilera.com>
Subject: Re: [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute
Date: Wed, 25 May 2011 22:20:23 +0200	[thread overview]
Message-ID: <201105252220.23948.arnd__26726.8515461639$1306354885$gmane$org@arndb.de> (raw)
In-Reply-To: <4DDD55ED.2080607@tilera.com>

On Wednesday 25 May 2011 21:18:05 Chris Metcalf wrote:
> (Resending with no HTML for LKML.)
> 
> 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.

Ok, sounds good.

> 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.

ok. I suppose you could make a non-hardwall file that you can link to,
but an empty file also sounds ok.

> 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.

ok.

> 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.

Be careful with listing PID values in the hardwall files, as the PIDs
may not be unique or visible if you combine this with PID name spaces.
I guess the right solution would be to only list the tasks that are
present in the name space of the thread reading the file.

> > 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.

I just checked for other users. The only one I could find was
drivers/xen/sys-hypervisor.c, and it also doesn't use a subdirectory to
identify that hypervisor. It's probably more consistent if you also don't
do it then.

You can create a directory with multiple files using sysfs_create_group()
as the xen code does, but not nested directories.

	Arnd

  reply	other threads:[~2011-05-25 20:20 UTC|newest]

Thread overview: 110+ 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  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
2011-05-19 15:22             ` Arnd Bergmann
2011-05-19 15:22             ` Arnd Bergmann
2011-05-20 14:26               ` Chris Metcalf
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:00                   ` Chris Metcalf
2011-05-20 15:13                     ` Arnd Bergmann
2011-05-20 19:59                       ` Arnd Bergmann
2011-05-20 19:59                       ` Arnd Bergmann
2011-05-25 19:09                         ` Chris Metcalf
2011-05-25 19:17                         ` Chris Metcalf
2011-05-25 19:18                         ` Chris Metcalf
2011-05-25 20:20                           ` Arnd Bergmann [this message]
2011-05-25 20:20                           ` Arnd Bergmann
2011-05-25 20:31                             ` Chris Metcalf
2011-05-25 20:34                               ` Arnd Bergmann
2011-05-25 20:34                               ` Arnd Bergmann
2011-05-25 20:31                             ` Chris Metcalf
2011-05-26 16:40                             ` [PATCH v2] arch/tile: more /proc and /sys file support Chris Metcalf
2011-05-27 14:23                               ` Arnd Bergmann
2011-05-27 14:23                               ` Arnd Bergmann
2011-05-26 16:40                             ` Chris Metcalf
2011-05-25 19:18                         ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Chris Metcalf
2011-05-20 15:13                     ` Arnd Bergmann
2011-05-20 14:37                 ` Arnd Bergmann
2011-05-24 15:38               ` Arnd Bergmann
2011-05-24 15:38               ` 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:01 ` 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:09 ` 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:16 ` Chris Metcalf
2010-05-29  3:17 ` [PATCH 8/8] arch/tile: hypervisor console driver Chris Metcalf
2010-05-29  3:17 ` 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
2010-05-29  3:20 ` 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='201105252220.23948.arnd__26726.8515461639$1306354885$gmane$org@arndb.de' \
    --to=arnd@arndb.de \
    --cc=cmetcalf@tilera.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.