Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148173
b: refs/heads/master
c: 8429db5
h: refs/heads/master
i:
  148171: 53b95ee
v: v3
  • Loading branch information
Pekka Enberg committed Jun 12, 2009
1 parent 8aa0327 commit dc753b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 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: 7e85ee0c1d15ca5f8bff0f514f158eba1742dd87
refs/heads/master: 8429db5c6336083594036c30f49401405d536911
37 changes: 19 additions & 18 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ static enum {
NONE,
PARTIAL_AC,
PARTIAL_L3,
EARLY,
FULL
} g_cpucache_up;

Expand All @@ -767,7 +768,7 @@ static enum {
*/
int slab_is_available(void)
{
return g_cpucache_up == FULL;
return g_cpucache_up >= EARLY;
}

static DEFINE_PER_CPU(struct delayed_work, reap_work);
Expand Down Expand Up @@ -1631,19 +1632,27 @@ void __init kmem_cache_init(void)
}
}

/* 6) resize the head arrays to their final sizes */
{
struct kmem_cache *cachep;
mutex_lock(&cache_chain_mutex);
list_for_each_entry(cachep, &cache_chain, next)
if (enable_cpucache(cachep, GFP_NOWAIT))
BUG();
mutex_unlock(&cache_chain_mutex);
}
g_cpucache_up = EARLY;

/* Annotate slab for lockdep -- annotate the malloc caches */
init_lock_keys();
}

void __init kmem_cache_init_late(void)
{
struct kmem_cache *cachep;

/*
* Interrupts are enabled now so all GFP allocations are safe.
*/
slab_gfp_mask = __GFP_BITS_MASK;

/* 6) resize the head arrays to their final sizes */
mutex_lock(&cache_chain_mutex);
list_for_each_entry(cachep, &cache_chain, next)
if (enable_cpucache(cachep, GFP_NOWAIT))
BUG();
mutex_unlock(&cache_chain_mutex);

/* Done! */
g_cpucache_up = FULL;
Expand All @@ -1660,14 +1669,6 @@ void __init kmem_cache_init(void)
*/
}

void __init kmem_cache_init_late(void)
{
/*
* Interrupts are enabled now so all GFP allocations are safe.
*/
slab_gfp_mask = __GFP_BITS_MASK;
}

static int __init cpucache_init(void)
{
int cpu;
Expand Down

0 comments on commit dc753b9

Please sign in to comment.