Re: [PATCH -v5][RFC]: mutex: implement adaptive spinning

Ingo Molnar
2009-01-07T21:29:12Z

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> /*
> * Even if the access succeeded (likely case),
> * the cpu field may no longer be valid. FIXME:
> * this needs to validate that we can do a
> * get_cpu() and that we have the percpu area.

s/get_cpu/cpu_rq ?

> */
> if (cpu >= NR_CPUS)
> break;
>
> if (!cpu_online(cpu))
> break;

Regarding the FIXME, this should be safe already - at least on x86 we set
up all the possible-cpus-mask per CPU areas during bootup. So any CPU that
is online, will have a percpu area. (even in the most racy case)

Ingo