lkml.org 
[lkml]   [2007]   [May]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 10 May 2007 16:09:10 -0700
FromUlrich Drepper <>
SubjectRe: getcpu after sched_setaffinity
Andi Kleen wrote:
> Probably. In principle getcpu() (where does the sched_ come from btw?)

getcpu() is an unacceptable name.  All te other functions dealing with 
CPU (sets, etc) have a sched_ prefix.


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

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


> Hmm ok one could probably define memset(..., 0) as a invalidation
> interface, but because of the considerations above i don't think
> it is really needed.

It is needed.

For now I added the cache clearing in the setaffinity calls in libc. 
Resetting to cache to {0,0} seems to work.
-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-10 23:11    [from the cache]
©2003-2008