From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org, Anton Blanchard <anton@samba.org>,
mahesh@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc: Export PIR data through sysfs
Date: Wed, 9 Nov 2011 10:11:24 +0530 [thread overview]
Message-ID: <20111109044124.GA10961@in.ibm.com> (raw)
In-Reply-To: <4EB96002.5030605@freescale.com>
On Tue, Nov 08, 2011 at 10:59:46AM -0600, Scott Wood wrote:
> On 11/08/2011 12:58 AM, Ananth N Mavinakayanahalli wrote:
> > On Mon, Nov 07, 2011 at 11:18:32AM -0600, Scott Wood wrote:
> >> What use does userspace have for this? If you want to return the
> >> currently executing CPU (which unless you're pinned could change as soon
> >> as the value is read...), why not just return smp_processor_id() or
> >> hard_smp_processor_id()?
> >
> > Its not just the current cpu. Decoding PIR can tell you the core id,
> > thread id in case of SMT, and this information can be used by userspace
> > apps to set affinities, etc.
>
> Wouldn't it make more sense to expose the thread to core mappings in a
> general way, not tied to hardware or what thread we're currently running on?
AFAIK, the information encoding in PIR is platform dependent. There is
no general way to expose this information unless you want have a
per-platform ifdef. Even then, I am not sure if that information will
generally be available or provided.
> What's the use case for knowing this information only about the current
> thread (or rather the state the current thread was in a few moments ago)?
Its not information about the thread but about the cpu. Unless you have
a shared LPAR environment, the data will be consistent and can be used
by applications with knowledge of the platform.
> > +#if defined(CONFIG_SMP) && defined(SPRN_PIR)
> > +SYSFS_PMCSETUP(pir, SPRN_PIR);
> > +static SYSDEV_ATTR(pir, 0400, show_pir, NULL);
> > +#endif
>
> This only helps on architectures such as 8xx where you can't build as
> SMP -- and I don't think #ifdef SPRN_PIR excludes any builds.
>
> It doesn't help on chips like 750 or e300 where you can run a normal 6xx
> SMP build, you just won't have multiple CPUs, and thus won't run things
> like the secondary entry code.
Ugh! Booke builds seem to be fun :-)
I think this calls for a CPU_FTR_PIR. What do you suggest?
Ananth
next prev parent reply other threads:[~2011-11-09 4:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 4:47 [PATCH] powerpc: Export PIR data through sysfs Ananth N Mavinakayanahalli
2011-11-07 17:18 ` Scott Wood
2011-11-08 6:58 ` Ananth N Mavinakayanahalli
2011-11-08 16:59 ` Scott Wood
2011-11-09 4:41 ` Ananth N Mavinakayanahalli [this message]
2011-11-09 15:48 ` Scott Wood
2011-11-10 8:48 ` Ananth N Mavinakayanahalli
2011-11-11 4:18 ` Benjamin Herrenschmidt
2011-11-11 4:47 ` Ananth N Mavinakayanahalli
2011-11-11 5:58 ` [PATCH V2] " Ananth N Mavinakayanahalli
2011-11-09 6:51 ` [PATCH] " Michael Ellerman
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=20111109044124.GA10961@in.ibm.com \
--to=ananth@in.ibm.com \
--cc=anton@samba.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
--cc=scottwood@freescale.com \
/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;
as well as URLs for NNTP newsgroup(s).