From deefaf284f94b7e9207d67951ef97d3f01529e95 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 29 May 2008 11:17:02 -0700 Subject: [PATCH] --- yaml --- r: 100195 b: refs/heads/master c: 68f4f1ec08e3d95730a2693b99df8260aa0d06ae h: refs/heads/master i: 100193: 69f403596cfae801025f3958b1f60cbec966bea5 100191: 3f0853de750eafc3c7aebdd8be52943d9194a95c v: v3 --- [refs] | 2 +- trunk/kernel/Makefile | 4 ++-- trunk/kernel/cpu.c | 24 ++++++++++++++++++++++++ trunk/kernel/sched.c | 18 ------------------ 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 7a392ff7ec87..b90052984bb4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5c8e1ed1d204a6770ca2854cd3b3597070fe7e5a +refs/heads/master: 68f4f1ec08e3d95730a2693b99df8260aa0d06ae diff --git a/trunk/kernel/Makefile b/trunk/kernel/Makefile index ecdd2d335639..6c55301112e0 100644 --- a/trunk/kernel/Makefile +++ b/trunk/kernel/Makefile @@ -3,7 +3,7 @@ # obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ - exit.o itimer.o time.o softirq.o resource.o \ + cpu.o exit.o itimer.o time.o softirq.o resource.o \ sysctl.o capability.o ptrace.o timer.o user.o \ signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o extable.o params.o posix-timers.o \ @@ -27,7 +27,7 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o -obj-$(CONFIG_SMP) += cpu.o spinlock.o +obj-$(CONFIG_SMP) += spinlock.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o obj-$(CONFIG_PROVE_LOCKING) += spinlock.o obj-$(CONFIG_UID16) += uid16.o diff --git a/trunk/kernel/cpu.c b/trunk/kernel/cpu.c index c77bc3a1c722..b11f06dc149a 100644 --- a/trunk/kernel/cpu.c +++ b/trunk/kernel/cpu.c @@ -15,6 +15,28 @@ #include #include +/* + * Represents all cpu's present in the system + * In systems capable of hotplug, this map could dynamically grow + * as new cpu's are detected in the system via any platform specific + * method, such as ACPI for e.g. + */ +cpumask_t cpu_present_map __read_mostly; +EXPORT_SYMBOL(cpu_present_map); + +#ifndef CONFIG_SMP + +/* + * Represents all cpu's that are currently online. + */ +cpumask_t cpu_online_map __read_mostly = CPU_MASK_ALL; +EXPORT_SYMBOL(cpu_online_map); + +cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; +EXPORT_SYMBOL(cpu_possible_map); + +#else /* CONFIG_SMP */ + /* Serializes the updates to cpu_online_map, cpu_present_map */ static DEFINE_MUTEX(cpu_add_remove_lock); @@ -403,3 +425,5 @@ void __ref enable_nonboot_cpus(void) cpu_maps_update_done(); } #endif /* CONFIG_PM_SLEEP_SMP */ + +#endif /* CONFIG_SMP */ diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 1ddb0a8c7976..f36f549e5744 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5080,24 +5080,6 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, return sched_setaffinity(pid, &new_mask); } -/* - * Represents all cpu's present in the system - * In systems capable of hotplug, this map could dynamically grow - * as new cpu's are detected in the system via any platform specific - * method, such as ACPI for e.g. - */ - -cpumask_t cpu_present_map __read_mostly; -EXPORT_SYMBOL(cpu_present_map); - -#ifndef CONFIG_SMP -cpumask_t cpu_online_map __read_mostly = CPU_MASK_ALL; -EXPORT_SYMBOL(cpu_online_map); - -cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; -EXPORT_SYMBOL(cpu_possible_map); -#endif - long sched_getaffinity(pid_t pid, cpumask_t *mask) { struct task_struct *p;