Skip to content

Commit

Permalink
slub: Allow removal of slab caches during boot
Browse files Browse the repository at this point in the history
If a slab cache is removed before we have setup sysfs then simply skip over
the sysfs handling.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Roland Dreier <rdreier@cisco.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Jul 16, 2010
1 parent d7278bd commit f5b801a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -4507,6 +4507,13 @@ static int sysfs_slab_add(struct kmem_cache *s)

static void sysfs_slab_remove(struct kmem_cache *s)
{
if (slab_state < SYSFS)
/*
* Sysfs has not been setup yet so no need to remove the
* cache from sysfs.
*/
return;

kobject_uevent(&s->kobj, KOBJ_REMOVE);
kobject_del(&s->kobj);
kobject_put(&s->kobj);
Expand Down

0 comments on commit f5b801a

Please sign in to comment.