From: Richard Weinberger <richard@nod.at>
To: akpm@linux-foundation.org
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, pat-lkml@erley.org,
Richard Weinberger <richard@nod.at>
Subject: [PATCH v2] Call arch_pick_mmap_layout() only once
Date: Tue, 14 Jan 2014 18:27:52 +0100 [thread overview]
Message-ID: <1389720472-28362-1-git-send-email-richard@nod.at> (raw)
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
reply other threads:[~2014-01-14 17:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389720472-28362-1-git-send-email-richard@nod.at \
--to=richard@nod.at \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pat-lkml@erley.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).