[PATCH 06/16] slab: put forward freeing slab management object
From: Joonsoo Kim
Date: Thu Aug 22 2013 - 04:44:39 EST
We don't need to free slab management object in rcu context,
because, from now on, we don't manage this slab anymore.
So put forward freeing.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
diff --git a/mm/slab.c b/mm/slab.c
index b378f91..607a9b8 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1820,8 +1820,6 @@ static void kmem_rcu_free(struct rcu_head *head)
struct kmem_cache *cachep = slab_rcu->page->slab_cache;
kmem_freepages(cachep, slab_rcu->page);
- if (OFF_SLAB(cachep))
- kmem_cache_free(cachep->slabp_cache, slab_rcu);
}
#if DEBUG
@@ -2047,11 +2045,16 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
slab_rcu = (struct slab_rcu *)slabp;
slab_rcu->page = page;
call_rcu(&slab_rcu->head, kmem_rcu_free);
- } else {
+
+ } else
kmem_freepages(cachep, page);
- if (OFF_SLAB(cachep))
- kmem_cache_free(cachep->slabp_cache, slabp);
- }
+
+ /*
+ * From now on, we don't use slab management
+ * although actual page will be freed in rcu context.
+ */
+ if (OFF_SLAB(cachep))
+ kmem_cache_free(cachep->slabp_cache, slabp);
}
/**
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/