aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5b3f6ec1b0b..f04aa966450 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -69,7 +69,6 @@
69#include <linux/pagemap.h> 69#include <linux/pagemap.h>
70#include <linux/hrtimer.h> 70#include <linux/hrtimer.h>
71#include <linux/tick.h> 71#include <linux/tick.h>
72#include <linux/bootmem.h>
73#include <linux/debugfs.h> 72#include <linux/debugfs.h>
74#include <linux/ctype.h> 73#include <linux/ctype.h>
75#include <linux/ftrace.h> 74#include <linux/ftrace.h>
@@ -7825,24 +7824,21 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd)
7825 7824
7826static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) 7825static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem)
7827{ 7826{
7827 gfp_t gfp = GFP_KERNEL;
7828
7828 memset(rd, 0, sizeof(*rd)); 7829 memset(rd, 0, sizeof(*rd));
7829 7830
7830 if (bootmem) { 7831 if (bootmem)
7831 alloc_bootmem_cpumask_var(&def_root_domain.span); 7832 gfp = GFP_NOWAIT;
7832 alloc_bootmem_cpumask_var(&def_root_domain.online);
7833 alloc_bootmem_cpumask_var(&def_root_domain.rto_mask);
7834 cpupri_init(&rd->cpupri, true);
7835 return 0;
7836 }
7837 7833
7838 if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) 7834 if (!alloc_cpumask_var(&rd->span, gfp))
7839 goto out; 7835 goto out;
7840 if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) 7836 if (!alloc_cpumask_var(&rd->online, gfp))
7841 goto free_span; 7837 goto free_span;
7842 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) 7838 if (!alloc_cpumask_var(&rd->rto_mask, gfp))
7843 goto free_online; 7839 goto free_online;
7844 7840
7845 if (cpupri_init(&rd->cpupri, false) != 0) 7841 if (cpupri_init(&rd->cpupri, bootmem) != 0)
7846 goto free_rto_mask; 7842 goto free_rto_mask;
7847 return 0; 7843 return 0;
7848 7844
@@ -9166,7 +9162,7 @@ void __init sched_init(void)
9166 * we use alloc_bootmem(). 9162 * we use alloc_bootmem().
9167 */ 9163 */
9168 if (alloc_size) { 9164 if (alloc_size) {
9169 ptr = (unsigned long)alloc_bootmem(alloc_size); 9165 ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
9170 9166
9171#ifdef CONFIG_FAIR_GROUP_SCHED 9167#ifdef CONFIG_FAIR_GROUP_SCHED
9172 init_task_group.se = (struct sched_entity **)ptr; 9168 init_task_group.se = (struct sched_entity **)ptr;
@@ -9357,13 +9353,13 @@ void __init sched_init(void)
9357 current->sched_class = &fair_sched_class; 9353 current->sched_class = &fair_sched_class;
9358 9354
9359 /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ 9355 /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */
9360 alloc_bootmem_cpumask_var(&nohz_cpu_mask); 9356 alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
9361#ifdef CONFIG_SMP 9357#ifdef CONFIG_SMP
9362#ifdef CONFIG_NO_HZ 9358#ifdef CONFIG_NO_HZ
9363 alloc_bootmem_cpumask_var(&nohz.cpu_mask); 9359 alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
9364 alloc_bootmem_cpumask_var(&nohz.ilb_grp_nohz_mask); 9360 alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
9365#endif 9361#endif
9366 alloc_bootmem_cpumask_var(&cpu_isolated_map); 9362 alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
9367#endif /* SMP */ 9363#endif /* SMP */
9368 9364
9369 perf_counter_init(); 9365 perf_counter_init();