diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-11 07:41:22 +0200 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-11 18:27:12 +0200 |
commit | 0fb530291621c8b8a1b16abeeab05d9262489f71 (patch) | |
tree | 4b5fbb1781b279caf9cd20fb1ef5d04028548f43 /kernel/sched_cpupri.c | |
parent | sched: use alloc_cpumask_var() instead of alloc_bootmem_cpumask_var() (diff) | |
download | linux-0fb530291621c8b8a1b16abeeab05d9262489f71.tar.xz linux-0fb530291621c8b8a1b16abeeab05d9262489f71.zip |
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 <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'kernel/sched_cpupri.c')
-rw-r--r-- | kernel/sched_cpupri.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c index 344712a5e3ed..7deffc9f0e5f 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; } |