[PATCH] 2.3.47: Optimize entry.S and hw_irq.h

From: Rainer Keller (Rainer.Keller@studmail.uni-stuttgart.de)
Date: Thu Feb 24 2000 - 04:19:10 EST


Hi Linus,
After several tests and some suggestions, I'd like someone to also test
this optimisations, as they were considerably improving performance on
my Pentium 133.

For reasons, why this patch should be applied, see my previous Email.

Timings so far (all kernel compilations were done in Single User mode,
right after booting on a distclean kernelsource):
Command:

time make oldconfig dep bzlilo

Running Kernel Times: Kernel-Size:
Kernel 2.3.39 real: 22m17.186s
                     user: 19m42.880s
                     sys: 1m13.930s

Kernel 2.3.47 real: 21m32.763s 491815 Bytes
                     user: 19m35.340s
                     sys: 1m13.340s

Kernel 2.3.47-OPT real: 20m15.021s 491921 Bytes
                     user: 18m20.580s
                     sys: 1m 4.930s

I will now, try to come up with some other tests (rdtsc and PIII
timings).
Also, I'm interested in other opinions, so please test this patch

Greetings,
raY

-- 
------------------------------------------------------------------------
Rainer Keller            e-mail: Rainer.Keller@studmail.uni-stuttgart.de
Universitaetsstr. 100    WWW: http://wg100.wh.uni-stuttgart.de/~ray
70569 Stuttgart          Tel. 0711 / 6787536

--- linux-2.3.46/arch/i386/kernel/entry.S Sun Feb 20 11:50:41 2000 +++ linux-2.3.46-mine/arch/i386/kernel/entry.S Sun Feb 20 20:31:51 2000 @@ -82,7 +82,6 @@ #define SAVE_ALL \ - cld; \ pushl %es; \ pushl %ds; \ pushl %eax; \ @@ -92,10 +91,28 @@ pushl %edx; \ pushl %ecx; \ pushl %ebx; \ + cld; \ movl $(__KERNEL_DS),%edx; \ movl %edx,%ds; \ movl %edx,%es; +#define SAVE_ALL_GET_CURRENT(reg) \ + pushl %es; \ + pushl %ds; \ + pushl %eax; \ + pushl %ebp; \ + pushl %edi; \ + pushl %esi; \ + pushl %edx; \ + pushl %ecx; \ + pushl %ebx; \ + cld; \ + movl $(__KERNEL_DS),%edx; \ + movl %esp, reg; \ + movl %edx,%ds; \ + movl %edx,%es; \ + andl $-8192, reg; \ + #define RESTORE_ALL \ popl %ebx; \ popl %ecx; \ @@ -192,8 +209,7 @@ ENTRY(system_call) pushl %eax # save orig_eax - SAVE_ALL - GET_CURRENT(%ebx) + SAVE_ALL_GET_CURRENT(%ebx) cmpl $(NR_syscalls),%eax jae badsys testb $0x20,flags(%ebx) # PF_TRACESYS @@ -327,8 +343,7 @@ ENTRY(device_not_available) pushl $-1 # mark this as an int - SAVE_ALL - GET_CURRENT(%ebx) + SAVE_ALL_GET_CURRENT(%ebx) pushl $ret_from_exception movl %cr0,%eax testl $0x4,%eax # EM (math emulation bit)

--- linux-2.3.46/include/asm-i386/hw_irq.h Tue Feb 1 02:14:00 2000 +++ linux-2.3.46-mine/include/asm-i386/hw_irq.h Sun Feb 20 14:39:58 2000 @@ -95,7 +95,6 @@ #define STR(x) __STR(x) #define SAVE_ALL \ - "cld\n\t" \ "pushl %es\n\t" \ "pushl %ds\n\t" \ "pushl %eax\n\t" \ @@ -105,6 +104,7 @@ "pushl %edx\n\t" \ "pushl %ecx\n\t" \ "pushl %ebx\n\t" \ + "cld\n\t" \ "movl $" STR(__KERNEL_DS) ",%edx\n\t" \ "movl %edx,%ds\n\t" \ "movl %edx,%es\n\t"

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



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:09 EST