]> git.hungrycats.org Git - linux/commit
[PATCH] slab: fix off-by-one in size calculation
authorAndrew Morton <akpm@digeo.com>
Fri, 28 Mar 2003 11:18:18 +0000 (03:18 -0800)
committerDave Jones <davej@tetrachloride.(none)>
Fri, 28 Mar 2003 11:18:18 +0000 (03:18 -0800)
commit16d99651b8c1eef9e58ad7c45d845b1e4328f14f
tree2d5a0f511da62ba8e9417041012af005250274bd
parent9d3488a87cb356a740187371e94d86a601a48bd1
[PATCH] slab: fix off-by-one in size calculation

From: Manfred Spraul <manfred@colorfullife.com>

Brian spotted a stupid bug in the slab initialization:

If multiple objects fit into one cacheline, then the allocator ignores
SLAB_HWCACHE_ALIGN and squeezes the objects into the same cacheline.  The
implementation contains an off by one error and thus doesn't work correctly:
For Athlon optimized kernels, the 32-byte slab uses 64 byte of memory.
mm/slab.c