diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/fork.c | 11 | ||||
| -rw-r--r-- | kernel/module.c | 2 | ||||
| -rw-r--r-- | kernel/sched.c | 5 | ||||
| -rw-r--r-- | kernel/softirq.c | 1 | ||||
| -rw-r--r-- | kernel/tsacct.c | 6 | ||||
| -rw-r--r-- | kernel/user.c | 14 |
6 files changed, 22 insertions, 17 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 8de303bdd4e5..6715ebc3761d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -1184,10 +1184,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
| 1184 | #endif | 1184 | #endif |
| 1185 | clear_all_latency_tracing(p); | 1185 | clear_all_latency_tracing(p); |
| 1186 | 1186 | ||
| 1187 | /* Our parent execution domain becomes current domain | ||
| 1188 | These must match for thread signalling to apply */ | ||
| 1189 | p->parent_exec_id = p->self_exec_id; | ||
| 1190 | |||
| 1191 | /* ok, now we should be set up.. */ | 1187 | /* ok, now we should be set up.. */ |
| 1192 | p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL); | 1188 | p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL); |
| 1193 | p->pdeath_signal = 0; | 1189 | p->pdeath_signal = 0; |
| @@ -1225,10 +1221,13 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
| 1225 | set_task_cpu(p, smp_processor_id()); | 1221 | set_task_cpu(p, smp_processor_id()); |
| 1226 | 1222 | ||
| 1227 | /* CLONE_PARENT re-uses the old parent */ | 1223 | /* CLONE_PARENT re-uses the old parent */ |
| 1228 | if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) | 1224 | if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) { |
| 1229 | p->real_parent = current->real_parent; | 1225 | p->real_parent = current->real_parent; |
| 1230 | else | 1226 | p->parent_exec_id = current->parent_exec_id; |
| 1227 | } else { | ||
| 1231 | p->real_parent = current; | 1228 | p->real_parent = current; |
| 1229 | p->parent_exec_id = current->self_exec_id; | ||
| 1230 | } | ||
| 1232 | 1231 | ||
| 1233 | spin_lock(¤t->sighand->siglock); | 1232 | spin_lock(¤t->sighand->siglock); |
| 1234 | 1233 | ||
diff --git a/kernel/module.c b/kernel/module.c index 1f0657ae555b..f0e04d6b67d8 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -381,7 +381,7 @@ static void *percpu_modalloc(unsigned long size, unsigned long align, | |||
| 381 | align = PAGE_SIZE; | 381 | align = PAGE_SIZE; |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | ptr = __alloc_percpu(size, align); | 384 | ptr = __alloc_reserved_percpu(size, align); |
| 385 | if (!ptr) | 385 | if (!ptr) |
| 386 | printk(KERN_WARNING | 386 | printk(KERN_WARNING |
| 387 | "Could not allocate %lu bytes percpu data\n", size); | 387 | "Could not allocate %lu bytes percpu data\n", size); |
diff --git a/kernel/sched.c b/kernel/sched.c index 0a76d0b6f215..61e63562f273 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -9599,10 +9599,11 @@ static void cpuacct_charge(struct task_struct *tsk, u64 cputime) | |||
| 9599 | cpu = task_cpu(tsk); | 9599 | cpu = task_cpu(tsk); |
| 9600 | ca = task_ca(tsk); | 9600 | ca = task_ca(tsk); |
| 9601 | 9601 | ||
| 9602 | for (; ca; ca = ca->parent) { | 9602 | do { |
| 9603 | u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); | 9603 | u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); |
| 9604 | *cpuusage += cputime; | 9604 | *cpuusage += cputime; |
| 9605 | } | 9605 | ca = ca->parent; |
| 9606 | } while (ca); | ||
| 9606 | } | 9607 | } |
| 9607 | 9608 | ||
| 9608 | struct cgroup_subsys cpuacct_subsys = { | 9609 | struct cgroup_subsys cpuacct_subsys = { |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 0365b4899a3d..57d3f67f6f38 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
| @@ -626,6 +626,7 @@ static int ksoftirqd(void * __bind_cpu) | |||
| 626 | preempt_enable_no_resched(); | 626 | preempt_enable_no_resched(); |
| 627 | cond_resched(); | 627 | cond_resched(); |
| 628 | preempt_disable(); | 628 | preempt_disable(); |
| 629 | rcu_qsctr_inc((long)__bind_cpu); | ||
| 629 | } | 630 | } |
| 630 | preempt_enable(); | 631 | preempt_enable(); |
| 631 | set_current_state(TASK_INTERRUPTIBLE); | 632 | set_current_state(TASK_INTERRUPTIBLE); |
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 43f891b05a4b..00d59d048edf 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
| @@ -122,8 +122,10 @@ void acct_update_integrals(struct task_struct *tsk) | |||
| 122 | if (likely(tsk->mm)) { | 122 | if (likely(tsk->mm)) { |
| 123 | cputime_t time, dtime; | 123 | cputime_t time, dtime; |
| 124 | struct timeval value; | 124 | struct timeval value; |
| 125 | unsigned long flags; | ||
| 125 | u64 delta; | 126 | u64 delta; |
| 126 | 127 | ||
| 128 | local_irq_save(flags); | ||
| 127 | time = tsk->stime + tsk->utime; | 129 | time = tsk->stime + tsk->utime; |
| 128 | dtime = cputime_sub(time, tsk->acct_timexpd); | 130 | dtime = cputime_sub(time, tsk->acct_timexpd); |
| 129 | jiffies_to_timeval(cputime_to_jiffies(dtime), &value); | 131 | jiffies_to_timeval(cputime_to_jiffies(dtime), &value); |
| @@ -131,10 +133,12 @@ void acct_update_integrals(struct task_struct *tsk) | |||
| 131 | delta = delta * USEC_PER_SEC + value.tv_usec; | 133 | delta = delta * USEC_PER_SEC + value.tv_usec; |
| 132 | 134 | ||
| 133 | if (delta == 0) | 135 | if (delta == 0) |
| 134 | return; | 136 | goto out; |
| 135 | tsk->acct_timexpd = time; | 137 | tsk->acct_timexpd = time; |
| 136 | tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm); | 138 | tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm); |
| 137 | tsk->acct_vm_mem1 += delta * tsk->mm->total_vm; | 139 | tsk->acct_vm_mem1 += delta * tsk->mm->total_vm; |
| 140 | out: | ||
| 141 | local_irq_restore(flags); | ||
| 138 | } | 142 | } |
| 139 | } | 143 | } |
| 140 | 144 | ||
diff --git a/kernel/user.c b/kernel/user.c index 6a9b696128c8..fbb300e6191f 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
| @@ -286,14 +286,12 @@ int __init uids_sysfs_init(void) | |||
| 286 | /* work function to remove sysfs directory for a user and free up | 286 | /* work function to remove sysfs directory for a user and free up |
| 287 | * corresponding structures. | 287 | * corresponding structures. |
| 288 | */ | 288 | */ |
| 289 | static void remove_user_sysfs_dir(struct work_struct *w) | 289 | static void cleanup_user_struct(struct work_struct *w) |
| 290 | { | 290 | { |
| 291 | struct user_struct *up = container_of(w, struct user_struct, work); | 291 | struct user_struct *up = container_of(w, struct user_struct, work); |
| 292 | unsigned long flags; | 292 | unsigned long flags; |
| 293 | int remove_user = 0; | 293 | int remove_user = 0; |
| 294 | 294 | ||
| 295 | if (up->user_ns != &init_user_ns) | ||
| 296 | return; | ||
| 297 | /* Make uid_hash_remove() + sysfs_remove_file() + kobject_del() | 295 | /* Make uid_hash_remove() + sysfs_remove_file() + kobject_del() |
| 298 | * atomic. | 296 | * atomic. |
| 299 | */ | 297 | */ |
| @@ -312,9 +310,11 @@ static void remove_user_sysfs_dir(struct work_struct *w) | |||
| 312 | if (!remove_user) | 310 | if (!remove_user) |
| 313 | goto done; | 311 | goto done; |
| 314 | 312 | ||
| 315 | kobject_uevent(&up->kobj, KOBJ_REMOVE); | 313 | if (up->user_ns == &init_user_ns) { |
| 316 | kobject_del(&up->kobj); | 314 | kobject_uevent(&up->kobj, KOBJ_REMOVE); |
| 317 | kobject_put(&up->kobj); | 315 | kobject_del(&up->kobj); |
| 316 | kobject_put(&up->kobj); | ||
| 317 | } | ||
| 318 | 318 | ||
| 319 | sched_destroy_user(up); | 319 | sched_destroy_user(up); |
| 320 | key_put(up->uid_keyring); | 320 | key_put(up->uid_keyring); |
| @@ -335,7 +335,7 @@ static void free_user(struct user_struct *up, unsigned long flags) | |||
| 335 | atomic_inc(&up->__count); | 335 | atomic_inc(&up->__count); |
| 336 | spin_unlock_irqrestore(&uidhash_lock, flags); | 336 | spin_unlock_irqrestore(&uidhash_lock, flags); |
| 337 | 337 | ||
| 338 | INIT_WORK(&up->work, remove_user_sysfs_dir); | 338 | INIT_WORK(&up->work, cleanup_user_struct); |
| 339 | schedule_work(&up->work); | 339 | schedule_work(&up->work); |
| 340 | } | 340 | } |
| 341 | 341 | ||
