RE: [PATCH] lockref: remove cpu_relax() again

From: Luck, Tony
Date: Thu Sep 05 2013 - 10:49:02 EST


> *If* however the cpu_relax() makes sense on other platforms maybe we could
> add something like we have already with "arch_mutex_cpu_relax()":

I'll do some more measurements on ia64. During my first tests cpu_relax() seemed
to be a big win - but I only ran "./t" a couple of times. Later (with the cpu_relax() in
place) I ran a bunch more iterations, and found that the variation from run to run
is much larger with lockref. The mean score is 60% higher, but the standard deviation
is an order of magnitude bigger (enough that one run out of 20 with lockref scored
lower than the pre-lockref kernel).

I think this is expected ... cmpxchg is a free-for-all - and sometimes poor placement
across the four socket system might cause short term starvation to a thread while
threads on another socket monopolize the cache line.

-Tony
--
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/