From 72b05f5763b6450b59c829d5ffa6a46305ebef90 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 15 Oct 2008 22:04:15 -0700 Subject: [PATCH] --- yaml --- r: 114891 b: refs/heads/master c: c7637941d16ae426a94058fe3b5460a31f68f61b h: refs/heads/master i: 114889: e2b62508172aa21d8483735507b8421c3254e8b1 114887: a420cbf56bd6ef76b9570460d34563037e55167e v: v3 --- [refs] | 2 +- trunk/fs/binfmt_elf_fdpic.c | 25 ++++++++----------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 7b8bdb207820..f3ede687fefd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ec23847d6cfe445ba9a1a5ec513297f4cc0ada53 +refs/heads/master: c7637941d16ae426a94058fe3b5460a31f68f61b diff --git a/trunk/fs/binfmt_elf_fdpic.c b/trunk/fs/binfmt_elf_fdpic.c index e4eb472558ca..9eee649449a8 100644 --- a/trunk/fs/binfmt_elf_fdpic.c +++ b/trunk/fs/binfmt_elf_fdpic.c @@ -466,7 +466,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, #endif /* - * present useful information to the program + * present useful information to the program by shovelling it onto the new + * process's stack */ static int create_elf_fdpic_tables(struct linux_binprm *bprm, struct mm_struct *mm, @@ -482,9 +483,13 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, int loop; int nr; /* reset for each csp adjustment */ - /* we're going to shovel a whole load of stuff onto the stack */ #ifdef CONFIG_MMU - sp = bprm->p; + /* In some cases (e.g. Hyper-Threading), we want to avoid L1 evictions + * by the processes running on the same package. One thing we can do is + * to shuffle the initial stack for them, so we give the architecture + * an opportunity to do so here. + */ + sp = arch_align_stack(bprm->p); #else sp = mm->start_stack; @@ -527,20 +532,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, return -EFAULT; } -#if defined(__i386__) && defined(CONFIG_SMP) - /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions - * by the processes running on the same package. One thing we can do is - * to shuffle the initial stack for them. - * - * the conditionals here are unneeded, but kept in to make the code - * behaviour the same as pre change unless we have hyperthreaded - * processors. This keeps Mr Marcelo Person happier but should be - * removed for 2.5 - */ - if (smp_num_siblings > 1) - sp = sp - ((current->pid % 64) << 7); -#endif - sp &= ~7UL; /* stack the load map(s) */