diff options
| -rw-r--r-- | kernel/Makefile | 4 | ||||
| -rw-r--r-- | kernel/cpu.c | 24 | ||||
| -rw-r--r-- | kernel/sched.c | 18 |
3 files changed, 26 insertions, 20 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index ecdd2d335639..6c55301112e0 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ | 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ |
| 6 | exit.o itimer.o time.o softirq.o resource.o \ | 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ |
| 7 | sysctl.o capability.o ptrace.o timer.o user.o \ | 7 | sysctl.o capability.o ptrace.o timer.o user.o \ |
| 8 | signal.o sys.o kmod.o workqueue.o pid.o \ | 8 | signal.o sys.o kmod.o workqueue.o pid.o \ |
| 9 | rcupdate.o extable.o params.o posix-timers.o \ | 9 | rcupdate.o extable.o params.o posix-timers.o \ |
| @@ -27,7 +27,7 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o | |||
| 27 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o | 27 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o |
| 28 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o | 28 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o |
| 29 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o | 29 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o |
| 30 | obj-$(CONFIG_SMP) += cpu.o spinlock.o | 30 | obj-$(CONFIG_SMP) += spinlock.o |
| 31 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o | 31 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o |
| 32 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o | 32 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o |
| 33 | obj-$(CONFIG_UID16) += uid16.o | 33 | obj-$(CONFIG_UID16) += uid16.o |
diff --git a/kernel/cpu.c b/kernel/cpu.c index c77bc3a1c722..b11f06dc149a 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
| @@ -15,6 +15,28 @@ | |||
| 15 | #include <linux/stop_machine.h> | 15 | #include <linux/stop_machine.h> |
| 16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 17 | 17 | ||
| 18 | /* | ||
| 19 | * Represents all cpu's present in the system | ||
| 20 | * In systems capable of hotplug, this map could dynamically grow | ||
| 21 | * as new cpu's are detected in the system via any platform specific | ||
| 22 | * method, such as ACPI for e.g. | ||
| 23 | */ | ||
| 24 | cpumask_t cpu_present_map __read_mostly; | ||
| 25 | EXPORT_SYMBOL(cpu_present_map); | ||
| 26 | |||
| 27 | #ifndef CONFIG_SMP | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Represents all cpu's that are currently online. | ||
| 31 | */ | ||
| 32 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_ALL; | ||
| 33 | EXPORT_SYMBOL(cpu_online_map); | ||
| 34 | |||
| 35 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; | ||
| 36 | EXPORT_SYMBOL(cpu_possible_map); | ||
| 37 | |||
| 38 | #else /* CONFIG_SMP */ | ||
| 39 | |||
| 18 | /* Serializes the updates to cpu_online_map, cpu_present_map */ | 40 | /* Serializes the updates to cpu_online_map, cpu_present_map */ |
| 19 | static DEFINE_MUTEX(cpu_add_remove_lock); | 41 | static DEFINE_MUTEX(cpu_add_remove_lock); |
| 20 | 42 | ||
| @@ -403,3 +425,5 @@ out: | |||
| 403 | cpu_maps_update_done(); | 425 | cpu_maps_update_done(); |
| 404 | } | 426 | } |
| 405 | #endif /* CONFIG_PM_SLEEP_SMP */ | 427 | #endif /* CONFIG_PM_SLEEP_SMP */ |
| 428 | |||
| 429 | #endif /* CONFIG_SMP */ | ||
diff --git a/kernel/sched.c b/kernel/sched.c index 1ddb0a8c7976..f36f549e5744 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -5080,24 +5080,6 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
| 5080 | return sched_setaffinity(pid, &new_mask); | 5080 | return sched_setaffinity(pid, &new_mask); |
| 5081 | } | 5081 | } |
| 5082 | 5082 | ||
| 5083 | /* | ||
| 5084 | * Represents all cpu's present in the system | ||
| 5085 | * In systems capable of hotplug, this map could dynamically grow | ||
| 5086 | * as new cpu's are detected in the system via any platform specific | ||
| 5087 | * method, such as ACPI for e.g. | ||
| 5088 | */ | ||
| 5089 | |||
| 5090 | cpumask_t cpu_present_map __read_mostly; | ||
| 5091 | EXPORT_SYMBOL(cpu_present_map); | ||
| 5092 | |||
| 5093 | #ifndef CONFIG_SMP | ||
| 5094 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_ALL; | ||
| 5095 | EXPORT_SYMBOL(cpu_online_map); | ||
| 5096 | |||
| 5097 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; | ||
| 5098 | EXPORT_SYMBOL(cpu_possible_map); | ||
| 5099 | #endif | ||
| 5100 | |||
| 5101 | long sched_getaffinity(pid_t pid, cpumask_t *mask) | 5083 | long sched_getaffinity(pid_t pid, cpumask_t *mask) |
| 5102 | { | 5084 | { |
| 5103 | struct task_struct *p; | 5085 | struct task_struct *p; |
