diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-07-15 16:18:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-17 06:06:22 -0400 |
commit | 68c38fc3cb4e5a60f502ee9c45f3dfe70e5165ad (patch) | |
tree | 32293b2fd969c57032407294863c1f2ee6bf5996 /kernel/sched.c | |
parent | bbc8cb5baead9607309583b20873ab0cc8d89eaf (diff) |
sched: No need for bootmem special cases
As of commit dcce284 ("mm: Extend gfp masking to the page
allocator") and commit 7e85ee0 ("slab,slub: don't enable
interrupts during early boot"), the slab allocator makes
sure we don't attempt to sleep during boot.
Therefore, remove bootmem special cases from the scheduler
and use plain GFP_KERNEL instead.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1279225102-2572-1-git-send-email-penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 9064e7d6ad65..7b443ee27be4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -6248,23 +6248,18 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd) | |||
6248 | free_rootdomain(old_rd); | 6248 | free_rootdomain(old_rd); |
6249 | } | 6249 | } |
6250 | 6250 | ||
6251 | static int init_rootdomain(struct root_domain *rd, bool bootmem) | 6251 | static int init_rootdomain(struct root_domain *rd) |
6252 | { | 6252 | { |
6253 | gfp_t gfp = GFP_KERNEL; | ||
6254 | |||
6255 | memset(rd, 0, sizeof(*rd)); | 6253 | memset(rd, 0, sizeof(*rd)); |
6256 | 6254 | ||
6257 | if (bootmem) | 6255 | if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) |
6258 | gfp = GFP_NOWAIT; | ||
6259 | |||
6260 | if (!alloc_cpumask_var(&rd->span, gfp)) | ||
6261 | goto out; | 6256 | goto out; |
6262 | if (!alloc_cpumask_var(&rd->online, gfp)) | 6257 | if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) |
6263 | goto free_span; | 6258 | goto free_span; |
6264 | if (!alloc_cpumask_var(&rd->rto_mask, gfp)) | 6259 | if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) |
6265 | goto free_online; | 6260 | goto free_online; |
6266 | 6261 | ||
6267 | if (cpupri_init(&rd->cpupri, bootmem) != 0) | 6262 | if (cpupri_init(&rd->cpupri) != 0) |
6268 | goto free_rto_mask; | 6263 | goto free_rto_mask; |
6269 | return 0; | 6264 | return 0; |
6270 | 6265 | ||
@@ -6280,7 +6275,7 @@ out: | |||
6280 | 6275 | ||
6281 | static void init_defrootdomain(void) | 6276 | static void init_defrootdomain(void) |
6282 | { | 6277 | { |
6283 | init_rootdomain(&def_root_domain, true); | 6278 | init_rootdomain(&def_root_domain); |
6284 | 6279 | ||
6285 | atomic_set(&def_root_domain.refcount, 1); | 6280 | atomic_set(&def_root_domain.refcount, 1); |
6286 | } | 6281 | } |
@@ -6293,7 +6288,7 @@ static struct root_domain *alloc_rootdomain(void) | |||
6293 | if (!rd) | 6288 | if (!rd) |
6294 | return NULL; | 6289 | return NULL; |
6295 | 6290 | ||
6296 | if (init_rootdomain(rd, false) != 0) { | 6291 | if (init_rootdomain(rd) != 0) { |
6297 | kfree(rd); | 6292 | kfree(rd); |
6298 | return NULL; | 6293 | return NULL; |
6299 | } | 6294 | } |