lkml.org 
[lkml]   [2008]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lib/idr.c: initialize struct idr_layer
On Jan 27, 2008 10:35 PM, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> > I think there's a pretty big chance I'm wrong (or misunderstanding
> > something) here, so I'll just ask:
> > setup_object() from mm/slub.c is what calls the ctor. Shouldn't this
> > be called from slab_alloc() as well? (I'm marking the data
> > "uninitialized" there before returning the object.) Otherwise you
> > might get back an object that is initialized with the previous owner's
> > data. Or is this intentional?
>
> It's intentional. The caller of kmem_cache_free() is expected to put
> the object in such a state that it can be recycled immediately when
> kmem_cache_alloc() for that cache is called. You can find the design
> rationale for that in Bonwick's original paper on slab:
> http://citeseer.ist.psu.edu/bonwick94slab.html

Ow. I guess this is the end of the thread, then :-) My fault. Thanks!

Vegard


\
 
 \ /
  Last update: 2008-01-27 22:59    [W:0.611 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site