public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Andi Kleen <ak@suse.de>, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: getcpu after sched_setaffinity
Date: Fri, 11 May 2007 09:08:53 +0200	[thread overview]
Message-ID: <20070511070853.GD2012@bingen.suse.de> (raw)
In-Reply-To: <4643A616.3090202@redhat.com>

On Thu, May 10, 2007 at 04:09:10PM -0700, Ulrich Drepper wrote:
> >is only designed for the case where you don't set the affinity explicitely;
> >otherwise you should already know where you are and don't need it.
> 
> That's not true in general.  Yes, because I want to test vgetcpu() I 
> restrict the set to just one CPU.
> 
> But if I have more than 2 "CPUs" and I set the affinity to two CPUs 
> which currently are not used you cannot make this argument.

All the users I talked to never mentioned this as a use case.
They were only interested in fully unrestricted programs. 

Anyways you can handle it too, just invalidate or do getcpu with 
a new cache afterwards.

Or just wait the jiffie for the cache to expire.

> 
> getcpu should always work correctly not only if you cannot determine it 
> in another way.

getcpu by design is approximate. If you don't understand this
don't bother using it.

-Andi


  reply	other threads:[~2007-05-11  6:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 22:24 getcpu after sched_setaffinity Ulrich Drepper
2007-05-10 23:44 ` Andi Kleen
2007-05-10 23:09   ` Ulrich Drepper
2007-05-11  7:08     ` Andi Kleen [this message]
2007-05-12 10:16 ` Bert Wesarg

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=20070511070853.GD2012@bingen.suse.de \
    --to=ak@suse.de \
    --cc=drepper@redhat.com \
    --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