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

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

 



On Sun, Aug 07, 2011 at 06:30:38PM +0900, Akinobu Mita wrote:
> The check_bytes() function is used by slub debugging.  It returns a pointer
> to the first unmatching byte for a character in the given memory area.
> 
> If the character for matching byte is greater than 0x80, check_bytes()
> doesn't work.  Becuase 64-bit pattern is generated as below.
> 
> 	value64 = value | value << 8 | value << 16 | value << 24;
> 	value64 = value64 | value64 << 32;
> 
> The integer promotions are performed and sign-extended as the type of value
> is u8.  The upper 32 bits of value64 is 0xffffffff in the first line, and
> the second line has no effect.
> 
> This fixes the 64-bit pattern generation.

Thank you. I'm a bit ashamed about this bug... I introduced this bug, so:
Reviewed-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>

I tested your patch to check if performance improvements of commit
c4089f98e943ff445665dea49c190657b34ccffe come from this bug or not.
And forunately they aren't - performance is exactly the same.

How did you find it?

Marcin

--
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=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[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]