diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 61bb1761c7b8..60d6fdcc9265 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -947,6 +947,8 @@ NORET_TYPE void do_exit(long code) | |||
947 | if (group_dead) { | 947 | if (group_dead) { |
948 | hrtimer_cancel(&tsk->signal->real_timer); | 948 | hrtimer_cancel(&tsk->signal->real_timer); |
949 | exit_itimers(tsk->signal); | 949 | exit_itimers(tsk->signal); |
950 | if (tsk->mm) | ||
951 | setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); | ||
950 | } | 952 | } |
951 | acct_collect(code, group_dead); | 953 | acct_collect(code, group_dead); |
952 | if (group_dead) | 954 | if (group_dead) |
@@ -1210,6 +1212,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1210 | if (likely(!traced) && likely(!task_detached(p))) { | 1212 | if (likely(!traced) && likely(!task_detached(p))) { |
1211 | struct signal_struct *psig; | 1213 | struct signal_struct *psig; |
1212 | struct signal_struct *sig; | 1214 | struct signal_struct *sig; |
1215 | unsigned long maxrss; | ||
1213 | 1216 | ||
1214 | /* | 1217 | /* |
1215 | * The resource counters for the group leader are in its | 1218 | * The resource counters for the group leader are in its |
@@ -1258,6 +1261,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1258 | psig->coublock += | 1261 | psig->coublock += |
1259 | task_io_get_oublock(p) + | 1262 | task_io_get_oublock(p) + |
1260 | 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; | ||
1261 | task_io_accounting_add(&psig->ioac, &p->ioac); | 1267 | task_io_accounting_add(&psig->ioac, &p->ioac); |
1262 | task_io_accounting_add(&psig->ioac, &sig->ioac); | 1268 | task_io_accounting_add(&psig->ioac, &sig->ioac); |
1263 | spin_unlock_irq(&p->real_parent->sighand->siglock); | 1269 | spin_unlock_irq(&p->real_parent->sighand->siglock); |