aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-11-24 11:05:13 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-24 11:52:22 -0500
commit68e74568fbe5854952355e942acca51f138096d9 (patch)
tree6263627b3b3c7e249f685ba0fe4d76002e882cd0 /kernel/sched.c
parent4212823fb459eacc8098dd420bb68ebb9917989d (diff)
sched: convert struct cpupri_vec cpumask_var_t.
Impact: stack usage reduction, (future) size reduction for large NR_CPUS. Dynamically allocating cpumasks (when CONFIG_CPUMASK_OFFSTACK) saves space for small nr_cpu_ids but big CONFIG_NR_CPUS. The fact cpupro_init is called both before and after the slab is available makes for an ugly parameter unfortunately. We also use cpumask_any_and to get rid of a temporary in cpupri_find. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 42588ad93b25..94fa333c1e7c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6792,6 +6792,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
6792 6792
6793static void free_rootdomain(struct root_domain *rd) 6793static void free_rootdomain(struct root_domain *rd)
6794{ 6794{
6795 cpupri_cleanup(&rd->cpupri);
6796
6795 free_cpumask_var(rd->rto_mask); 6797 free_cpumask_var(rd->rto_mask);
6796 free_cpumask_var(rd->online); 6798 free_cpumask_var(rd->online);
6797 free_cpumask_var(rd->span); 6799 free_cpumask_var(rd->span);
@@ -6834,7 +6836,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
6834 alloc_bootmem_cpumask_var(&def_root_domain.span); 6836 alloc_bootmem_cpumask_var(&def_root_domain.span);
6835 alloc_bootmem_cpumask_var(&def_root_domain.online); 6837 alloc_bootmem_cpumask_var(&def_root_domain.online);
6836 alloc_bootmem_cpumask_var(&def_root_domain.rto_mask); 6838 alloc_bootmem_cpumask_var(&def_root_domain.rto_mask);
6837 cpupri_init(&rd->cpupri); 6839 cpupri_init(&rd->cpupri, true);
6838 return 0; 6840 return 0;
6839 } 6841 }
6840 6842
@@ -6845,9 +6847,12 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
6845 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) 6847 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
6846 goto free_online; 6848 goto free_online;
6847 6849
6848 cpupri_init(&rd->cpupri); 6850 if (cpupri_init(&rd->cpupri, false) != 0)
6851 goto free_rto_mask;
6849 return 0; 6852 return 0;
6850 6853
6854free_rto_mask:
6855 free_cpumask_var(rd->rto_mask);
6851free_online: 6856free_online:
6852 free_cpumask_var(rd->online); 6857 free_cpumask_var(rd->online);
6853free_span: 6858free_span: