cpusets: allow cpusets to be configured/built on non-SMP systems

Previous thread: cpusets: replace zone allowed functions with node allowed by Linux Kernel Mailing List on Thursday, April 2, 2009 - 10:01 pm. (1 message)

Next thread: cpusets: prevent PF_THREAD_BOUND tasks from attaching to non-root cpusets by Linux Kernel Mailing List on Thursday, April 2, 2009 - 10:01 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, April 2, 2009 - 10:01 pm

Gitweb:     http://git.kernel.org/linus/db7f47cf4805e30decb0841764b21b7c4000f7dc
Commit:     db7f47cf4805e30decb0841764b21b7c4000f7dc
Parent:     a1bc5a4eee990a1f290735c8694d0aebdad095fa
Author:     Paul Menage <menage@google.com>
AuthorDate: Thu Apr 2 16:57:55 2009 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu Apr 2 19:04:57 2009 -0700

    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>
---
 init/Kconfig    |    2 +-
 kernel/cpuset.c |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index 92d4106..1398a14 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -531,7 +531,7 @@ config CGROUP_DEVICE
 
 config CPUSETS
 	bool "Cpuset support"
-	depends on SMP && CGROUPS
+	depends on CGROUPS
 	help
 	  This option will let you create and manage CPUSETs which
 	  allow dynamically partitioning a system into sets of CPUs and
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3ff910e..2b93b50 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -517,6 +517,7 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial)
 	return 0;
 }
 
+#ifdef CONFIG_SMP
 /*
  * Helper routine for ...
Previous thread: cpusets: replace zone allowed functions with node allowed by Linux Kernel Mailing List on Thursday, April 2, 2009 - 10:01 pm. (1 message)

Next thread: cpusets: prevent PF_THREAD_BOUND tasks from attaching to non-root cpusets by Linux Kernel Mailing List on Thursday, April 2, 2009 - 10:01 pm. (1 message)