[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070511070853.GD2012@bingen.suse.de>
Date: Fri, 11 May 2007 09:08:53 +0200
From: Andi Kleen <ak@...e.de>
To: Ulrich Drepper <drepper@...hat.com>
Cc: Andi Kleen <ak@...e.de>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: getcpu after sched_setaffinity
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists