Re: [RFC/PATCH 1/3] SLAB: Add PageSlab checking to ksize()

From: Paul Mundt
Date: Wed May 21 2008 - 19:47:44 EST


On Wed, May 21, 2008 at 09:25:26PM +0300, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
>
> The ksize() function is meant for objects allocated from the slab caches, not
> for arbitrary objects. Add a BUG_ON() to enforce that.
>
> Cc: Christoph Lameter <clameter@xxxxxxx>
> Cc: Matt Mackall <mpm@xxxxxxxxxxx>
> Cc: Paul Mundt <lethal@xxxxxxxxxxxx>
> Cc: David Howells <dhowells@xxxxxxxxxx>
> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>

This series seems to work ok with all of SLAB/SLUB/SLOB when also
applying the kobjsize() patch. Without the kobjsize() patch in place,
SLAB and SLUB both work, while SLOB still triggers the >= MAX_ORDER
BUG_ON() for page cache pages. Note that this is still an improvement
over SLUB blowing up, as it was before, even without the kobjsize()
change.
--
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/