From: Pekka Enberg Date: Thu, 11 Jun 2009 05:41:22 +0000 (+0300) Subject: sched: use slab in cpupri_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0fb530291621c8b8a1b16abeeab05d9262489f71;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git sched: use slab in cpupri_init() Lets not use the bootmem allocator in cpupri_init() as slab is already up when it is run. Cc: Ingo Molnar Cc: Linus Torvalds Cc: Yinghai Lu Signed-off-by: Pekka Enberg --- diff --git a/kernel/sched.c b/kernel/sched.c index 12cc09cf514..dcf2dc28931 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -7795,7 +7795,7 @@ static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) if (!alloc_cpumask_var(&rd->rto_mask, gfp)) goto free_online; - if (cpupri_init(&rd->cpupri, false) != 0) + if (cpupri_init(&rd->cpupri, bootmem) != 0) goto free_rto_mask; return 0; diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c index 344712a5e3e..7deffc9f0e5 100644 --- a/kernel/sched_cpupri.c +++ b/kernel/sched_cpupri.c @@ -154,8 +154,12 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) */ int __init_refok cpupri_init(struct cpupri *cp, bool bootmem) { + gfp_t gfp = GFP_KERNEL; int i; + if (bootmem) + gfp = GFP_NOWAIT; + memset(cp, 0, sizeof(*cp)); for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) { @@ -163,9 +167,7 @@ int __init_refok cpupri_init(struct cpupri *cp, bool bootmem) spin_lock_init(&vec->lock); vec->count = 0; - if (bootmem) - alloc_bootmem_cpumask_var(&vec->mask); - else if (!zalloc_cpumask_var(&vec->mask, GFP_KERNEL)) + if (!zalloc_cpumask_var(&vec->mask, gfp)) goto cleanup; }