Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used

From
Li Zhong <hidden>
Date
2012-07-05 01:41:36
Also in
linux-mm, lkml
Reply to
Glauber Costa, 2012-07-04
On Wed, 2012-07-04 at 16:40 +0400, Glauber Costa wrote:
On 07/04/2012 01:00 PM, Li Zhong wrote:
quoted
On Tue, 2012-07-03 at 15:36 -0500, Christoph Lameter wrote:
quoted
quoted
Looking through the emails it seems that there is an issue with alias
strings. 
To be more precise, there seems no big issue currently. I just wanted to
make following usage of kmem_cache_create (SLUB) possible:

	name = some string kmalloced
	kmem_cache_create(name, ...)
	kfree(name);
Out of curiosity: Why?
This is not (currently) possible with the other allocators (may change
with christoph's unification patches), so you would be making your code
slub-dependent.
For slub itself, I think it's not good that: in some cases, the name
string could be kfreed ( if it was kmalloced ) immediately after calling
the cache create; in some other case, the name string needs to be kept
valid until some init calls finished. 

I agree with you that it would make the code slub-dependent, so I'm now
working on the consistency of the other allocators regarding this name
string duplicating thing. 
Thread (18 messages) 18 messages, 5 authors, last reply 2012-07-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help