Commit db7f47cf4805e30decb0841764b21b7c4000f7dc
Committed by
Linus Torvalds
1 parent
a1bc5a4eee
Exists in
master
and in
4 other branches
cpusets: allow cpusets to be configured/built on non-SMP systems
Allow cpusets to be configured/built on non-SMP systems Currently it's impossible to build cpusets under UML on x86-64, since cpusets depends on SMP and x86-64 UML doesn't support SMP. There's code in cpusets that doesn't depend on SMP. This patch surrounds the minimum amount of cpusets code with #ifdef CONFIG_SMP in order to allow cpusets to build/run on UP systems (for testing purposes under UML). Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Paul Menage <menage@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 2 changed files with 16 additions and 1 deletions Side-by-side Diff
init/Kconfig
kernel/cpuset.c
| ... | ... | @@ -517,6 +517,7 @@ |
| 517 | 517 | return 0; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | +#ifdef CONFIG_SMP | |
| 520 | 521 | /* |
| 521 | 522 | * Helper routine for generate_sched_domains(). |
| 522 | 523 | * Do cpusets a, b have overlapping cpus_allowed masks? |
| 523 | 524 | |
| ... | ... | @@ -811,7 +812,19 @@ |
| 811 | 812 | |
| 812 | 813 | put_online_cpus(); |
| 813 | 814 | } |
| 815 | +#else /* !CONFIG_SMP */ | |
| 816 | +static void do_rebuild_sched_domains(struct work_struct *unused) | |
| 817 | +{ | |
| 818 | +} | |
| 814 | 819 | |
| 820 | +static int generate_sched_domains(struct cpumask **domains, | |
| 821 | + struct sched_domain_attr **attributes) | |
| 822 | +{ | |
| 823 | + *domains = NULL; | |
| 824 | + return 1; | |
| 825 | +} | |
| 826 | +#endif /* CONFIG_SMP */ | |
| 827 | + | |
| 815 | 828 | static DECLARE_WORK(rebuild_sched_domains_work, do_rebuild_sched_domains); |
| 816 | 829 | |
| 817 | 830 | /* |
| 818 | 831 | |
| ... | ... | @@ -1164,8 +1177,10 @@ |
| 1164 | 1177 | |
| 1165 | 1178 | static int update_relax_domain_level(struct cpuset *cs, s64 val) |
| 1166 | 1179 | { |
| 1180 | +#ifdef CONFIG_SMP | |
| 1167 | 1181 | if (val < -1 || val >= SD_LV_MAX) |
| 1168 | 1182 | return -EINVAL; |
| 1183 | +#endif | |
| 1169 | 1184 | |
| 1170 | 1185 | if (val != cs->relax_domain_level) { |
| 1171 | 1186 | cs->relax_domain_level = val; |