diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index e47ee8a06135..60d6fdcc9265 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -359,8 +359,10 @@ void __set_special_pids(struct pid *pid) | |||
359 | { | 359 | { |
360 | struct task_struct *curr = current->group_leader; | 360 | struct task_struct *curr = current->group_leader; |
361 | 361 | ||
362 | if (task_session(curr) != pid) | 362 | if (task_session(curr) != pid) { |
363 | change_pid(curr, PIDTYPE_SID, pid); | 363 | change_pid(curr, PIDTYPE_SID, pid); |
364 | proc_sid_connector(curr); | ||
365 | } | ||
364 | 366 | ||
365 | if (task_pgrp(curr) != pid) | 367 | if (task_pgrp(curr) != pid) |
366 | change_pid(curr, PIDTYPE_PGID, pid); | 368 | change_pid(curr, PIDTYPE_PGID, pid); |
@@ -945,6 +947,8 @@ NORET_TYPE void do_exit(long code) | |||
945 | if (group_dead) { | 947 | if (group_dead) { |
946 | hrtimer_cancel(&tsk->signal->real_timer); | 948 | hrtimer_cancel(&tsk->signal->real_timer); |
947 | exit_itimers(tsk->signal); | 949 | exit_itimers(tsk->signal); |
950 | if (tsk->mm) | ||
951 | setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); | ||
948 | } | 952 | } |
949 | acct_collect(code, group_dead); | 953 | acct_collect(code, group_dead); |
950 | if (group_dead) | 954 | if (group_dead) |
@@ -1208,6 +1212,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1208 | if (likely(!traced) && likely(!task_detached(p))) { | 1212 | if (likely(!traced) && likely(!task_detached(p))) { |
1209 | struct signal_struct *psig; | 1213 | struct signal_struct *psig; |
1210 | struct signal_struct *sig; | 1214 | struct signal_struct *sig; |
1215 | unsigned long maxrss; | ||
1211 | 1216 | ||
1212 | /* | 1217 | /* |
1213 | * The resource counters for the group leader are in its | 1218 | * The resource counters for the group leader are in its |
@@ -1256,6 +1261,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1256 | psig->coublock += | 1261 | psig->coublock += |
1257 | task_io_get_oublock(p) + | 1262 | task_io_get_oublock(p) + |
1258 | sig->oublock + sig->coublock; | 1263 | sig->oublock + sig->coublock; |
1264 | maxrss = max(sig->maxrss, sig->cmaxrss); | ||
1265 | if (psig->cmaxrss < maxrss) | ||
1266 | psig->cmaxrss = maxrss; | ||
1259 | task_io_accounting_add(&psig->ioac, &p->ioac); | 1267 | task_io_accounting_add(&psig->ioac, &p->ioac); |
1260 | task_io_accounting_add(&psig->ioac, &sig->ioac); | 1268 | task_io_accounting_add(&psig->ioac, &sig->ioac); |
1261 | spin_unlock_irq(&p->real_parent->sighand->siglock); | 1269 | spin_unlock_irq(&p->real_parent->sighand->siglock); |