[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1409112211060.30537@file01.intranet.prod.int.rdu2.redhat.com>
Date: Thu, 11 Sep 2014 22:32:52 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Christoph Lameter <cl@...ux.com>
cc: Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Alasdair G. Kergon" <agk@...hat.com>,
Mike Snitzer <msnitzer@...hat.com>,
Milan Broz <gmazyland@...il.com>, kkolasa@...soft.pl,
dm-devel@...hat.com
Subject: Re: [PATCH] slab: implement kmalloc guard
On Mon, 8 Sep 2014, Christoph Lameter wrote:
> On Mon, 8 Sep 2014, Mikulas Patocka wrote:
>
> > I don't know what you mean. If someone allocates 10000 objects with sizes
> > from 1 to 10000, you can't have 10000 slab caches - you can't have a slab
> > cache for each used size. Also - you can't create a slab cache in
> > interrupt context.
>
> Oh you can create them up front on bootup. And I think only the small
> sizes matter. Allocations >=8K are pushed to the page allocator anyways.
Only for SLUB. For SLAB, large allocations are still use SLAB caches up to
4M. But anyway - having 8K preallocated slab caches is too much.
If you want to integrate this patch into the slab/slub subsystem, a better
solution would be to store the exact size requested with kmalloc along the
slab/slub object itself (before the preceding redzone). But it would
result in duplicating the work - you'd have to repeat the logic in this
patch three times - once for slab, once for slub and once for
kmalloc_large/kmalloc_large_node.
I don't know if it would be better than this patch.
> > > We already have a redzone structure to check for writes over the end of
> > > the object. Lets use that.
> >
> > So, change all three slab subsystems to use that.
>
> SLOB has no debugging features and I think that was intentional. We are
> trying to unify the debug checks etc. Some work on that would be
> appreciated. I think the kmalloc creation is already in slab_common.c
Mikulas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists