diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-11-02 23:23:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-04 07:16:40 -0500 |
commit | acc3f5d7cabbfd6cec71f0c1f9900621fa2d6ae7 (patch) | |
tree | 672ed45f6df2f52e8f3cced2ee11ad29a1533890 /include/linux/sched.h | |
parent | e2c880630438f80b474378d5487b511b07665051 (diff) |
cpumask: Partition_sched_domains takes array of cpumask_var_t
Currently partition_sched_domains() takes a 'struct cpumask
*doms_new' which is a kmalloc'ed array of cpumask_t. You can't
have such an array if 'struct cpumask' is undefined, as we plan
for CONFIG_CPUMASK_OFFSTACK=y.
So, we make this an array of cpumask_var_t instead: this is the
same for the CONFIG_CPUMASK_OFFSTACK=n case, but requires
multiple allocations for the CONFIG_CPUMASK_OFFSTACK=y case.
Hence we add alloc_sched_domains() and free_sched_domains()
functions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <200911031453.40668.rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index dfc21fb76bf1..78ba664474f3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1009,9 +1009,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | |||
1009 | return to_cpumask(sd->span); | 1009 | return to_cpumask(sd->span); |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1012 | extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
1013 | struct sched_domain_attr *dattr_new); | 1013 | struct sched_domain_attr *dattr_new); |
1014 | 1014 | ||
1015 | /* Allocate an array of sched domains, for partition_sched_domains(). */ | ||
1016 | cpumask_var_t *alloc_sched_domains(unsigned int ndoms); | ||
1017 | void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); | ||
1018 | |||
1015 | /* Test a flag in parent sched domain */ | 1019 | /* Test a flag in parent sched domain */ |
1016 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | 1020 | static inline int test_sd_parent(struct sched_domain *sd, int flag) |
1017 | { | 1021 | { |
@@ -1029,7 +1033,7 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); | |||
1029 | struct sched_domain_attr; | 1033 | struct sched_domain_attr; |
1030 | 1034 | ||
1031 | static inline void | 1035 | static inline void |
1032 | partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1036 | partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
1033 | struct sched_domain_attr *dattr_new) | 1037 | struct sched_domain_attr *dattr_new) |
1034 | { | 1038 | { |
1035 | } | 1039 | } |