Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20190
b: refs/heads/master
c: f0188f4
h: refs/heads/master
v: v3
  • Loading branch information
Ravikiran G Thirumalai authored and Linus Torvalds committed Feb 10, 2006
1 parent 5871fd8 commit 0840aa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 8e36709d8cea48a4d341294ce2b46678a2e77159
refs/heads/master: f0188f47482efdbd2e005103bb4f0224a835dfad
10 changes: 7 additions & 3 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,12 @@ kmem_cache_create (const char *name, size_t size, size_t align,
BUG();
}

/*
* Prevent CPUs from coming and going.
* lock_cpu_hotplug() nests outside cache_chain_mutex
*/
lock_cpu_hotplug();

mutex_lock(&cache_chain_mutex);

list_for_each(p, &cache_chain) {
Expand Down Expand Up @@ -1918,8 +1924,6 @@ kmem_cache_create (const char *name, size_t size, size_t align,
cachep->dtor = dtor;
cachep->name = name;

/* Don't let CPUs to come and go */
lock_cpu_hotplug();

if (g_cpucache_up == FULL) {
enable_cpucache(cachep);
Expand Down Expand Up @@ -1978,12 +1982,12 @@ kmem_cache_create (const char *name, size_t size, size_t align,

/* cache setup completed, link it into the list */
list_add(&cachep->next, &cache_chain);
unlock_cpu_hotplug();
oops:
if (!cachep && (flags & SLAB_PANIC))
panic("kmem_cache_create(): failed to create slab `%s'\n",
name);
mutex_unlock(&cache_chain_mutex);
unlock_cpu_hotplug();
return cachep;
}
EXPORT_SYMBOL(kmem_cache_create);
Expand Down

0 comments on commit 0840aa1

Please sign in to comment.