Re: [slubllv7 06/17] slub: Add cmpxchg_double_slab()

From: H. Peter Anvin
Date: Tue Jul 12 2011 - 14:47:26 EST


On 07/12/2011 09:47 AM, Christoph Lameter wrote:
> On Tue, 12 Jul 2011, Eric Dumazet wrote:
>
>> Le mardi 12 juillet 2011 Ã 10:59 -0500, Christoph Lameter a Ãcrit :
>>
>>> We do not need to have _count included. This is just there because the
>>> field is in the way on 64 bit and we can only do 2x 64 bit cmpxchges. On
>>> 32 bi we can drop _count from "counters".
>>
>> OK, thanks for clarification.
>
> Still I'd like to get some ideas on how to make the whole thing much
> cleaner. Isnt there some way to convert a struct to an unsigned long
> without going through a union? And a way to convert a struct + 32 bit
> atomic_t into a 64 bit unsigned long? Would simplify things significantly.

If you know it is in memory you can cast ("pun") the pointer.

If it's not in memory that can be inefficient, though.

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