]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
exec: move de_thread()->setmax_mm_hiwater_rss() into exec_mmap()
authorOleg Nesterov <oleg@redhat.com>
Mon, 19 Mar 2012 16:04:01 +0000 (17:04 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 20 Mar 2012 21:16:50 +0000 (14:16 -0700)
Minor cleanup. de_thread()->setmax_mm_hiwater_rss() looks a bit
strange, move it into exec_mmap() which plays with old_mm.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c

index 1e94d2263ae08150d22c193809e384231db6440d..95551c6da0903746eea9f57c261b8b25b5603710 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -850,6 +850,7 @@ static int exec_mmap(struct mm_struct *mm)
        if (old_mm) {
                up_read(&old_mm->mmap_sem);
                BUG_ON(active_mm != old_mm);
+               setmax_mm_hiwater_rss(&tsk->signal->maxrss, old_mm);
                mm_update_next_owner(old_mm);
                mmput(old_mm);
                return 0;
@@ -980,9 +981,6 @@ no_thread_group:
        /* we have changed execution domain */
        tsk->exit_signal = SIGCHLD;
 
-       if (current->mm)
-               setmax_mm_hiwater_rss(&sig->maxrss, current->mm);
-
        exit_itimers(sig);
        flush_itimer_signals();