Re: [PATCH] slub: fix check_bytes() for slub debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/8/9 Eric Dumazet <eric.dumazet@xxxxxxxxx>:

>> > diff --git a/mm/slub.c b/mm/slub.c
>> > index eb5a8f9..5695f92 100644
>> > --- a/mm/slub.c
>> > +++ b/mm/slub.c
>> > @@ -701,7 +701,7 @@ static u8 *check_bytes(u8 *start, u8 value, unsigned int bytes)
>> >             return check_bytes8(start, value, bytes);
>> >
>> >     value64 = value | value << 8 | value << 16 | value << 24;
>> > -   value64 = value64 | value64 << 32;
>> > +   value64 = (value64 & 0xffffffff) | value64 << 32;
>> >     prefix = 8 - ((unsigned long)start) % 8;
>> >
>> >     if (prefix) {
>>
>> Still buggy I am afraid. Could we use the following ?
>>
>>
>>       value64 = value;
>>       value64 |= value64 << 8;
>>       value64 |= value64 << 16;
>>       value64 |= value64 << 32;
>>
>>
>
> Well, 'buggy' was not well chosen.
>
> Another possibility would be to use a multiply if arch has a fast
> multiplier...
>
>
>        value64 = value;
> #if defined(ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
>        value64 *= 0x0101010101010101;
> #elif defined(ARCH_HAS_FAST_MULTIPLIER)
>        value64 *= 0x01010101;
>        value64 |= value64 << 32;
> #else
>        value64 |= value64 << 8;
>        value64 |= value64 << 16;
>        value64 |= value64 << 32;
> #endif

I don't really care about which one should be used.  So tell me if I need
to resend it with this improvement.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]