lkml.org 
[lkml]   [1999]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: No kmem_cache_destroy?
   Date:   Fri, 6 Aug 1999 00:21:40 -0400
From: Johannes Erdfelt <jerdfelt@sventech.com>

I'd like to use a kmem_cache in the UHCI module, however I don't
see a good way of doing this. The comments in mm/slab.c are a
little confusing:

I've been meaning to fix this, the way to really do it is:

1) Never require that a slab gets destroyed. Even after the
module unloads, the cache will be shrunk naturally as the
system trims SLAB caches all the time when memory gets tight.

2) Have kmem_cache_create copy the string over into a new buffer,
so the reference to the string in the module doesn't exist.
In fact make kmem_cache_t->name[64] or whatever so that it
will still work while SLAB is setting itself up.

3) Have kmem_cache_create check to see if the slab exists already,
by comparing the name and the parameters. If they match, just
return the old slab cache pointer, don't make a new one.

This will solve all the problems in one go, and localize the changes
to one spot.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.068 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site