aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h3
-rw-r--r--kernel/exit.c5
-rw-r--r--kernel/tsacct.c4
-rw-r--r--mm/mmap.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 38a3f4b15394..ea415136ac9e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -386,6 +386,9 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
386 (mm)->hiwater_vm = (mm)->total_vm; \ 386 (mm)->hiwater_vm = (mm)->total_vm; \
387} while (0) 387} while (0)
388 388
389#define get_mm_hiwater_rss(mm) max((mm)->hiwater_rss, get_mm_rss(mm))
390#define get_mm_hiwater_vm(mm) max((mm)->hiwater_vm, (mm)->total_vm)
391
389extern void set_dumpable(struct mm_struct *mm, int value); 392extern void set_dumpable(struct mm_struct *mm, int value);
390extern int get_dumpable(struct mm_struct *mm); 393extern int get_dumpable(struct mm_struct *mm);
391 394
diff --git a/kernel/exit.c b/kernel/exit.c
index f923724ab3c9..c7740fa3252c 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1051,10 +1051,7 @@ NORET_TYPE void do_exit(long code)
1051 preempt_count()); 1051 preempt_count());
1052 1052
1053 acct_update_integrals(tsk); 1053 acct_update_integrals(tsk);
1054 if (tsk->mm) { 1054
1055 update_hiwater_rss(tsk->mm);
1056 update_hiwater_vm(tsk->mm);
1057 }
1058 group_dead = atomic_dec_and_test(&tsk->signal->live); 1055 group_dead = atomic_dec_and_test(&tsk->signal->live);
1059 if (group_dead) { 1056 if (group_dead) {
1060 hrtimer_cancel(&tsk->signal->real_timer); 1057 hrtimer_cancel(&tsk->signal->real_timer);
diff --git a/kernel/tsacct.c b/kernel/tsacct.c
index 2dc06ab35716..43f891b05a4b 100644
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -92,8 +92,8 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
92 mm = get_task_mm(p); 92 mm = get_task_mm(p);
93 if (mm) { 93 if (mm) {
94 /* adjust to KB unit */ 94 /* adjust to KB unit */
95 stats->hiwater_rss = mm->hiwater_rss * PAGE_SIZE / KB; 95 stats->hiwater_rss = get_mm_hiwater_rss(mm) * PAGE_SIZE / KB;
96 stats->hiwater_vm = mm->hiwater_vm * PAGE_SIZE / KB; 96 stats->hiwater_vm = get_mm_hiwater_vm(mm) * PAGE_SIZE / KB;
97 mmput(mm); 97 mmput(mm);
98 } 98 }
99 stats->read_char = p->ioac.rchar; 99 stats->read_char = p->ioac.rchar;
diff --git a/mm/mmap.c b/mm/mmap.c
index e4507b23e620..1f97d8aa9b05 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2102,7 +2102,7 @@ void exit_mmap(struct mm_struct *mm)
2102 lru_add_drain(); 2102 lru_add_drain();
2103 flush_cache_mm(mm); 2103 flush_cache_mm(mm);
2104 tlb = tlb_gather_mmu(mm, 1); 2104 tlb = tlb_gather_mmu(mm, 1);
2105 /* Don't update_hiwater_rss(mm) here, do_exit already did */ 2105 /* update_hiwater_rss(mm) here? but nobody should be looking */
2106 /* Use -1 here to ensure all VMAs in the mm are unmapped */ 2106 /* Use -1 here to ensure all VMAs in the mm are unmapped */
2107 end = unmap_vmas(&tlb, vma, 0, -1, &nr_accounted, NULL); 2107 end = unmap_vmas(&tlb, vma, 0, -1, &nr_accounted, NULL);
2108 vm_unacct_memory(nr_accounted); 2108 vm_unacct_memory(nr_accounted);