[lkml]   [2007]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
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
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-05-11 01:11    [W:0.054 / U:4.288 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site