Re: [PATCH v2] slab+slob: dup name string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 22 May 2012, Christoph Lameter wrote:

> > [ v2: Also dup string for early caches, requested by David Rientjes ]
> 
> kstrdups that early could cause additional issues. Its better to leave
> things as they were.
> 

No, it's not, there's no reason to prevent caches created before 
g_cpucache_up <= EARLY to be destroyed because it makes a patch easier to 
implement and then leave that little gotcha as an undocumented treasure 
for someone to find when they try it later on.

I hate consistency patches like this because it could potentially fail a 
kmem_cache_create() from a sufficiently long cache name when it wouldn't 
have before, but I'm not really concerned since kmem_cache_create() will 
naturally be followed by kmem_cache_alloc() which is more likely to cause 
the oom anyway.  But it's just another waste of memory for consistency 
sake.

This is much easier to do, just statically allocate the const char *'s 
needed for the boot caches and then set their ->name's manually in 
kmem_cache_init() and then avoid the kfree() in kmem_cache_destroy() if 
the name is between &boot_cache_name[0] and &boot_cache_name[n].
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux