Re: [cpuops cmpxchg double V2 1/4] Generic support for this_cpu_cmpxchg_double

From: H. Peter Anvin
Date: Thu Jan 06 2011 - 17:06:33 EST


On 01/06/2011 12:45 PM, Christoph Lameter wrote:
> Introduce this_cpu_cmpxchg_double. this_cpu_cmpxchg_double() allows the
> comparision between two consecutive words and replaces them if there is
> a match.
>
> bool this_cpu_cmpxchg_double(pcp1, pcp2,
> old_word1, old_word2, new_word1, new_word2)
>
> this_cpu_cmpxchg_double does not return the old value (difficult since
> there are two words) but a boolean indicating if the operation was
> successful.
>
> The first percpu variable must be double word aligned!

I really truly hate this interface. The whole notion of passing two
pointers where only one is really used, is just painful.

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