Re: arch_align_stack() seems useless

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Franck Bui-Huu
Date: Thursday, August 30, 2007 - 1:22 am

Arjan,

Franck Bui-Huu wrote:

Do you think that the diff below would be correct ? I tested it on
mips and it seems to work fine but I can't really say if it's
valid enough to submit it as a patch...

thanks
		Franck

---8<---

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 4482a06..024006e 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -151,6 +151,13 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
 	struct vm_area_struct *vma;
 
 	/*
+	 * 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.
+	 */
+	p = arch_align_stack(p);
+
+	/*
 	 * If this architecture has a platform capability string, copy it
 	 * to userspace.  In some cases (Sparc), this info is impossible
 	 * for userspace to get any other way, in others (i386) it is
@@ -160,14 +167,6 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
 	if (k_platform) {
 		size_t len = strlen(k_platform) + 1;
 
-		/*
-		 * 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.
-		 */
-
-		p = arch_align_stack(p);
-
 		u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
 		if (__copy_to_user(u_platform, k_platform, len))
 			return -EFAULT;
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
arch_align_stack() seems useless, Franck Bui-Huu, (Mon Aug 27, 7:08 am)
Re: arch_align_stack() seems useless, Arjan van de Ven, (Mon Aug 27, 7:14 am)
Re: arch_align_stack() seems useless, Franck Bui-Huu, (Tue Aug 28, 6:17 am)
Re: arch_align_stack() seems useless, Franck Bui-Huu, (Thu Aug 30, 1:22 am)