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

From: Ingo Molnar
Date: Wed Jan 07 2009 - 16:29:28 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/