Re: Reduce struct page by 8 bytes on 64bit

Andi Kleen (ak@muc.de)
Wed, 16 Apr 2003 16:07:15 +0200


On Wed, Apr 16, 2003 at 02:45:21PM +0200, David S. Miller wrote:
> From: Andi Kleen <ak@muc.de>
> Date: Tue, 15 Apr 2003 13:24:30 +0200
>
> I worked around this by declaring a new data type atomic_bitmask32
> with matching set_bit32/clear_bit32 etc. interfaces. Currently only
> on x86-64 aomitc_bitmask32 is defined to unsigned, everybody else
> still uses unsigned long. The other 64bit architectures can define it to
> unsigned too if they can confirm that it's ok to do.
>
> I have no problem with this.
>
> If you are clever, you can define a generic version even for the
> "unsigned long" 64-bit platforms. It's left as an exercise to
> the reader :-)

How so? Of course I could write an generic set_bit32, but the question
is if these bit operations would be still atomic on SMP and not conflict with
fields occuping the same 8 byte slot. I remember you flaming someone
some time ago because he used set_bit in an atomic fashion on a type smaller
than unsigned long for example.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/