diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-10 16:42:36 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-11 12:27:04 -0400 |
commit | 36b7b6d465489c4754c4fd66fcec6086eba87896 (patch) | |
tree | b24eb922eea26181157c7e99047933d3df08ecfb | |
parent | 444f478f65c7ca4606f9965b31feed13fe2bc9fa (diff) |
sched: use kzalloc() instead of the bootmem allocator
Now that kmem_cache_init() happens before sched_init(), we should use kzalloc()
and not the bootmem allocator.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
-rw-r--r-- | kernel/sched.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 14c447ae5d53..a9ff9533355b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -68,7 +68,6 @@ | |||
68 | #include <linux/pagemap.h> | 68 | #include <linux/pagemap.h> |
69 | #include <linux/hrtimer.h> | 69 | #include <linux/hrtimer.h> |
70 | #include <linux/tick.h> | 70 | #include <linux/tick.h> |
71 | #include <linux/bootmem.h> | ||
72 | #include <linux/debugfs.h> | 71 | #include <linux/debugfs.h> |
73 | #include <linux/ctype.h> | 72 | #include <linux/ctype.h> |
74 | #include <linux/ftrace.h> | 73 | #include <linux/ftrace.h> |
@@ -7782,21 +7781,18 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd) | |||
7782 | 7781 | ||
7783 | static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) | 7782 | static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) |
7784 | { | 7783 | { |
7784 | gfp_t gfp = GFP_KERNEL; | ||
7785 | |||
7785 | memset(rd, 0, sizeof(*rd)); | 7786 | memset(rd, 0, sizeof(*rd)); |
7786 | 7787 | ||
7787 | if (bootmem) { | 7788 | if (bootmem) |
7788 | alloc_bootmem_cpumask_var(&def_root_domain.span); | 7789 | gfp = GFP_NOWAIT; |
7789 | alloc_bootmem_cpumask_var(&def_root_domain.online); | ||
7790 | alloc_bootmem_cpumask_var(&def_root_domain.rto_mask); | ||
7791 | cpupri_init(&rd->cpupri, true); | ||
7792 | return 0; | ||
7793 | } | ||
7794 | 7790 | ||
7795 | if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) | 7791 | if (!alloc_cpumask_var(&rd->span, gfp)) |
7796 | goto out; | 7792 | goto out; |
7797 | if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) | 7793 | if (!alloc_cpumask_var(&rd->online, gfp)) |
7798 | goto free_span; | 7794 | goto free_span; |
7799 | if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) | 7795 | if (!alloc_cpumask_var(&rd->rto_mask, gfp)) |
7800 | goto free_online; | 7796 | goto free_online; |
7801 | 7797 | ||
7802 | if (cpupri_init(&rd->cpupri, false) != 0) | 7798 | if (cpupri_init(&rd->cpupri, false) != 0) |
@@ -9123,7 +9119,7 @@ void __init sched_init(void) | |||
9123 | * we use alloc_bootmem(). | 9119 | * we use alloc_bootmem(). |
9124 | */ | 9120 | */ |
9125 | if (alloc_size) { | 9121 | if (alloc_size) { |
9126 | ptr = (unsigned long)alloc_bootmem(alloc_size); | 9122 | ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT); |
9127 | 9123 | ||
9128 | #ifdef CONFIG_FAIR_GROUP_SCHED | 9124 | #ifdef CONFIG_FAIR_GROUP_SCHED |
9129 | init_task_group.se = (struct sched_entity **)ptr; | 9125 | init_task_group.se = (struct sched_entity **)ptr; |