From: Richard Weinberger <richard@nod.at>
Date: Thu, 23 Jan 2014 23:55:58 +0000 (-0800)
Subject: fs/exec.c: call arch_pick_mmap_layout() only once
X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~10989^2~19
X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3b96d7db3b6dc99d207bca50037274d22e48dea5;p=mirror_ubuntu-artful-kernel.git

fs/exec.c: call arch_pick_mmap_layout() only once

Currently both setup_new_exec() and flush_old_exec() issue a call to
arch_pick_mmap_layout().  As setup_new_exec() and flush_old_exec() are
always called pairwise arch_pick_mmap_layout() is called twice.

This patch removes one call from setup_new_exec() to have it only called
once.

Signed-off-by: Richard Weinberger <richard@nod.at>
Tested-by: Pat Erley <pat-lkml@erley.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/fs/exec.c b/fs/exec.c
index 44218a7267b2..e1529b4c79b1 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -842,7 +842,6 @@ static int exec_mmap(struct mm_struct *mm)
 	tsk->active_mm = mm;
 	activate_mm(active_mm, mm);
 	task_unlock(tsk);
-	arch_pick_mmap_layout(mm);
 	if (old_mm) {
 		up_read(&old_mm->mmap_sem);
 		BUG_ON(active_mm != old_mm);