* [PATCH v2] Call arch_pick_mmap_layout() only once
@ 2014-01-14 17:27 Richard Weinberger
0 siblings, 0 replies; only message in thread
From: Richard Weinberger @ 2014-01-14 17:27 UTC (permalink / raw)
To: akpm; +Cc: viro, linux-fsdevel, linux-kernel, pat-lkml, Richard Weinberger
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.
Tested-by: Pat Erley <pat-lkml@erley.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
Changes between v1 and v2:
Pat reported that v1 broke IA32 emulation on x86_64.
It turned out that we have to keep the second call to
arch_pick_mmap_layout() and are free to remove the first
one. v1 did it the other way around.
This is needed because only the latter call will see all
current->personality flags.
diff --git a/fs/exec.c b/fs/exec.c
index 7ea097f..a733599 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -843,7 +843,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);
--
1.8.4.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-14 17:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 17:27 [PATCH v2] Call arch_pick_mmap_layout() only once Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).