linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* slab vs. slub kmem cache name inconsistency
@ 2012-10-02  9:40 Johannes Berg
  2012-10-02 11:05 ` JoonSoo Kim
  2012-10-02 14:43 ` Christoph Lameter
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Berg @ 2012-10-02  9:40 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm

Hi,

I just noticed that slub's kmem_cache_create() will kstrdup() the name,
while slab doesn't. That's a little confusing, since when you look at
slub you can easily get away with passing a string you built on the
stack, while that will then lead to very strange results (and possibly
crashes?) with slab. The slab kernel-doc string always says this:

 * @name must be valid until the cache is destroyed. This implies that
 * the module calling this has to destroy the cache before getting unloaded.

Is there any reason for this difference, or should slab also kstrdup(),
or should slub not do it? Or maybe slub should have a "oops, name is on
stack" warning/check?

johannes

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-02 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02  9:40 slab vs. slub kmem cache name inconsistency Johannes Berg
2012-10-02 11:05 ` JoonSoo Kim
2012-10-02 11:08   ` Johannes Berg
2012-10-02 14:43 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).