From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH] nommu: Push kobjsize() slab-specific logic down to ksize(). From: Matt Mackall In-Reply-To: References: <20080520095935.GB18633@linux-sh.org> <2373.1211296724@redhat.com> <1211307820.18026.190.camel@calx> <1211310023.18026.210.camel@calx> Content-Type: text/plain Date: Tue, 20 May 2008 14:14:56 -0500 Message-Id: <1211310896.18026.214.camel@calx> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: David Howells , Paul Mundt , Pekka Enberg , linux-mm@kvack.org List-ID: On Tue, 2008-05-20 at 12:08 -0700, Christoph Lameter wrote: > On Tue, 20 May 2008, Matt Mackall wrote: > > > > Remove kobjsize completely and replace with calls to ksize? Callers must > > > not call ksize() on non slab objects. > > > > What'd you think of my idea of adding WARN_ONs to SLAB and SLUB for > > these cases? That is, warn whenever ksize() gets a non-kmalloced > > address? > > How would that work given that both SLUB and SLOB forward >4k allocs to > the page allocator? So any compound page allocation may be a slab > allocation. Is there some way to distinguish between a > allocations of the page allocator and a slab alloc? We can't do it at all for SLOB. But when debugging is turned on, we can notice (in SLAB and SLUB) whenever anyone asks for the ksize() of something that lives on a non-kmalloc slab. -- Mathematics is the supreme nostalgia of our time. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org