Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35612
b: refs/heads/master
c: 117f6eb
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Sep 26, 2006
1 parent 6f9c095 commit 55c4f3f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbe5e69d2d6e591996ea2b817b887d03b60bb143
refs/heads/master: 117f6eb1d8b8deb6f19fc88fc15bdb413c2a0c79
38 changes: 22 additions & 16 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,27 @@ static void set_up_list3s(struct kmem_cache *cachep, int index)
}
}

static void __kmem_cache_destroy(struct kmem_cache *cachep)
{
int i;
struct kmem_list3 *l3;

for_each_online_cpu(i)
kfree(cachep->array[i]);

/* NUMA: free the list3 structures */
for_each_online_node(i) {
l3 = cachep->nodelists[i];
if (l3) {
kfree(l3->shared);
free_alien_cache(l3->alien);
kfree(l3);
}
}
kmem_cache_free(&cache_cache, cachep);
}


/**
* calculate_slab_order - calculate size (page order) of slabs
* @cachep: pointer to the cache that is being created
Expand Down Expand Up @@ -2404,9 +2425,6 @@ EXPORT_SYMBOL(kmem_cache_shrink);
*/
int kmem_cache_destroy(struct kmem_cache *cachep)
{
int i;
struct kmem_list3 *l3;

BUG_ON(!cachep || in_interrupt());

/* Don't let CPUs to come and go */
Expand All @@ -2432,19 +2450,7 @@ int kmem_cache_destroy(struct kmem_cache *cachep)
if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU))
synchronize_rcu();

for_each_online_cpu(i)
kfree(cachep->array[i]);

/* NUMA: free the list3 structures */
for_each_online_node(i) {
l3 = cachep->nodelists[i];
if (l3) {
kfree(l3->shared);
free_alien_cache(l3->alien);
kfree(l3);
}
}
kmem_cache_free(&cache_cache, cachep);
__kmem_cache_destroy(cachep);
unlock_cpu_hotplug();
return 0;
}
Expand Down

0 comments on commit 55c4f3f

Please sign in to comment.