Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26710
b: refs/heads/master
c: 39d24e6
h: refs/heads/master
v: v3
  • Loading branch information
Mike Kravetz authored and Linus Torvalds committed May 15, 2006
1 parent f19c75e commit 945022a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 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: 48564e628bd7662d7a0b3ac81c41cd0e4cc36dae
refs/heads/master: 39d24e64263cd3211705d3b61ea4171c65030921
1 change: 1 addition & 0 deletions trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)

extern void kfree(const void *);
extern unsigned int ksize(const void *);
extern int slab_is_available(void);

#ifdef CONFIG_NUMA
extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
Expand Down
8 changes: 8 additions & 0 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,14 @@ static enum {
FULL
} g_cpucache_up;

/*
* used by boot code to determine if it can use slab based allocator
*/
int slab_is_available(void)
{
return g_cpucache_up == FULL;
}

static DEFINE_PER_CPU(struct work_struct, reap_work);

static void free_block(struct kmem_cache *cachep, void **objpp, int len,
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static struct mem_section *sparse_index_alloc(int nid)
unsigned long array_size = SECTIONS_PER_ROOT *
sizeof(struct mem_section);

if (system_state == SYSTEM_RUNNING)
if (slab_is_available())
section = kmalloc_node(array_size, GFP_KERNEL, nid);
else
section = alloc_bootmem_node(NODE_DATA(nid), array_size);
Expand Down

0 comments on commit 945022a

Please sign in to comment.