Re: Intel P6 vs P7 system call performance

Ulrich Drepper
2002-12-17T20:09:51Z

Linus Torvalds wrote:

> ===== arch/i386/kernel/sysenter.c 1.1 vs edited =====
> --- 1.1/arch/i386/kernel/sysenter.c Mon Dec 16 21:39:04 2002
> +++ edited/arch/i386/kernel/sysenter.c Tue Dec 17 11:39:39 2002
> @@ -48,14 +48,14 @@
> 0xc3 /* ret */
> };
> static const char sysent[] = {
> - 0x55, /* push %ebp */
> 0x51, /* push %ecx */
> 0x52, /* push %edx */
> + 0x55, /* push %ebp */
> 0x89, 0xe5, /* movl %esp,%ebp */
> 0x0f, 0x34, /* sysenter */
> + 0x5d, /* pop %ebp */
> 0x5a, /* pop %edx */
> 0x59, /* pop %ecx */
> - 0x5d, /* pop %ebp */
> 0xc3 /* ret */

Instead of duplicating the push/pop %ebp just use the first one by using

movl 12(%ebo), %ebp

in the kernel code or remove the first. The later is better, smaller code.

--
--------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------