Re: [patch] user-vm-unlock-2.5.31-A2

Ingo Molnar (mingo@elte.hu)
Thu, 15 Aug 2002 12:38:28 +0200 (CEST)


> > + childregs->esp -= sizeof(0UL);
> > + p->user_vm_lock = (long *) childregs->esp;
>
> you are right. Fix against BK-curr attached.

in fact testing these changes in glibc revealed another thing - the top of
the thread's stack has to be 16-byte aligned (for SSE2 support), so the
attached patch ontop of BK-curr would be a better solution, it does not
modify the thread's stack alignment but simply writes to the top of the
stack. (which is the first word of the thread control block.) This removes
a few instructions both from glibc and from the kernel.

Ingo

--- arch/i386/kernel/process.c.orig Thu Aug 15 08:37:52 2002
+++ arch/i386/kernel/process.c Thu Aug 15 12:36:57 2002
@@ -625,10 +625,8 @@
/*
* Does the userspace VM want any unlock on mm_release()?
*/
- if (clone_flags & CLONE_RELEASE_VM) {
- childregs->esp -= sizeof(0UL);
- p->user_vm_lock = (long *) esp;
- }
+ if (clone_flags & CLONE_RELEASE_VM)
+ p->user_vm_lock = (long *) childregs->esp;
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/