diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cpuset.c | 35 | ||||
| -rw-r--r-- | kernel/futex.c | 2 | ||||
| -rw-r--r-- | kernel/sched.c | 4 | ||||
| -rw-r--r-- | kernel/stop_machine.c | 1 |
4 files changed, 36 insertions, 6 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1a649f2bb9bb..4ea6f0dc2fc5 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
| @@ -816,6 +816,10 @@ static int update_cpumask(struct cpuset *cs, char *buf) | |||
| 816 | struct cpuset trialcs; | 816 | struct cpuset trialcs; |
| 817 | int retval, cpus_unchanged; | 817 | int retval, cpus_unchanged; |
| 818 | 818 | ||
| 819 | /* top_cpuset.cpus_allowed tracks cpu_online_map; it's read-only */ | ||
| 820 | if (cs == &top_cpuset) | ||
| 821 | return -EACCES; | ||
| 822 | |||
| 819 | trialcs = *cs; | 823 | trialcs = *cs; |
| 820 | retval = cpulist_parse(buf, trialcs.cpus_allowed); | 824 | retval = cpulist_parse(buf, trialcs.cpus_allowed); |
| 821 | if (retval < 0) | 825 | if (retval < 0) |
| @@ -2033,6 +2037,33 @@ out: | |||
| 2033 | return err; | 2037 | return err; |
| 2034 | } | 2038 | } |
| 2035 | 2039 | ||
| 2040 | /* | ||
| 2041 | * The top_cpuset tracks what CPUs and Memory Nodes are online, | ||
| 2042 | * period. This is necessary in order to make cpusets transparent | ||
| 2043 | * (of no affect) on systems that are actively using CPU hotplug | ||
| 2044 | * but making no active use of cpusets. | ||
| 2045 | * | ||
| 2046 | * This handles CPU hotplug (cpuhp) events. If someday Memory | ||
| 2047 | * Nodes can be hotplugged (dynamically changing node_online_map) | ||
| 2048 | * then we should handle that too, perhaps in a similar way. | ||
| 2049 | */ | ||
| 2050 | |||
| 2051 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 2052 | static int cpuset_handle_cpuhp(struct notifier_block *nb, | ||
| 2053 | unsigned long phase, void *cpu) | ||
| 2054 | { | ||
| 2055 | mutex_lock(&manage_mutex); | ||
| 2056 | mutex_lock(&callback_mutex); | ||
| 2057 | |||
| 2058 | top_cpuset.cpus_allowed = cpu_online_map; | ||
| 2059 | |||
| 2060 | mutex_unlock(&callback_mutex); | ||
| 2061 | mutex_unlock(&manage_mutex); | ||
| 2062 | |||
| 2063 | return 0; | ||
| 2064 | } | ||
| 2065 | #endif | ||
| 2066 | |||
| 2036 | /** | 2067 | /** |
| 2037 | * cpuset_init_smp - initialize cpus_allowed | 2068 | * cpuset_init_smp - initialize cpus_allowed |
| 2038 | * | 2069 | * |
| @@ -2043,6 +2074,8 @@ void __init cpuset_init_smp(void) | |||
| 2043 | { | 2074 | { |
| 2044 | top_cpuset.cpus_allowed = cpu_online_map; | 2075 | top_cpuset.cpus_allowed = cpu_online_map; |
| 2045 | top_cpuset.mems_allowed = node_online_map; | 2076 | top_cpuset.mems_allowed = node_online_map; |
| 2077 | |||
| 2078 | hotcpu_notifier(cpuset_handle_cpuhp, 0); | ||
| 2046 | } | 2079 | } |
| 2047 | 2080 | ||
| 2048 | /** | 2081 | /** |
| @@ -2387,7 +2420,7 @@ EXPORT_SYMBOL_GPL(cpuset_mem_spread_node); | |||
| 2387 | int cpuset_excl_nodes_overlap(const struct task_struct *p) | 2420 | int cpuset_excl_nodes_overlap(const struct task_struct *p) |
| 2388 | { | 2421 | { |
| 2389 | const struct cpuset *cs1, *cs2; /* my and p's cpuset ancestors */ | 2422 | const struct cpuset *cs1, *cs2; /* my and p's cpuset ancestors */ |
| 2390 | int overlap = 0; /* do cpusets overlap? */ | 2423 | int overlap = 1; /* do cpusets overlap? */ |
| 2391 | 2424 | ||
| 2392 | task_lock(current); | 2425 | task_lock(current); |
| 2393 | if (current->flags & PF_EXITING) { | 2426 | if (current->flags & PF_EXITING) { |
diff --git a/kernel/futex.c b/kernel/futex.c index d4633c588f33..b9b8aea5389e 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -397,7 +397,7 @@ static struct task_struct * futex_find_get_task(pid_t pid) | |||
| 397 | p = NULL; | 397 | p = NULL; |
| 398 | goto out_unlock; | 398 | goto out_unlock; |
| 399 | } | 399 | } |
| 400 | if (p->state == EXIT_ZOMBIE || p->exit_state == EXIT_ZOMBIE) { | 400 | if (p->exit_state != 0) { |
| 401 | p = NULL; | 401 | p = NULL; |
| 402 | goto out_unlock; | 402 | goto out_unlock; |
| 403 | } | 403 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index a2be2d055299..a234fbee1238 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -4162,10 +4162,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
| 4162 | read_unlock_irq(&tasklist_lock); | 4162 | read_unlock_irq(&tasklist_lock); |
| 4163 | return -ESRCH; | 4163 | return -ESRCH; |
| 4164 | } | 4164 | } |
| 4165 | get_task_struct(p); | ||
| 4166 | read_unlock_irq(&tasklist_lock); | ||
| 4167 | retval = sched_setscheduler(p, policy, &lparam); | 4165 | retval = sched_setscheduler(p, policy, &lparam); |
| 4168 | put_task_struct(p); | 4166 | read_unlock_irq(&tasklist_lock); |
| 4169 | 4167 | ||
| 4170 | return retval; | 4168 | return retval; |
| 4171 | } | 4169 | } |
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index dcfb5d731466..51cacd111dbd 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
| @@ -111,7 +111,6 @@ static int stop_machine(void) | |||
| 111 | /* If some failed, kill them all. */ | 111 | /* If some failed, kill them all. */ |
| 112 | if (ret < 0) { | 112 | if (ret < 0) { |
| 113 | stopmachine_set_state(STOPMACHINE_EXIT); | 113 | stopmachine_set_state(STOPMACHINE_EXIT); |
| 114 | up(&stopmachine_mutex); | ||
| 115 | return ret; | 114 | return ret; |
| 116 | } | 115 | } |
| 117 | 116 | ||
