diff -Napur -X /home/jbarnes/dontdiff linux-2.6.20/arch/x86_64/kernel/entry.S linux-2.6.20-delay-hack/arch/x86_64/kernel/entry.S --- linux-2.6.20/arch/x86_64/kernel/entry.S 2007-02-04 10:44:54.000000000 -0800 +++ linux-2.6.20-delay-hack/arch/x86_64/kernel/entry.S 2007-04-20 13:27:33.000000000 -0700 @@ -231,6 +231,8 @@ ENTRY(system_call) GET_THREAD_INFO(%rcx) testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) jnz tracesys + jmp syscall_delay_hack +ret_from_delay: cmpq $__NR_syscall_max,%rax ja badsys movq %r10,%rcx @@ -302,6 +304,12 @@ badsys: movq $-ENOSYS,RAX-ARGOFFSET(%rsp) jmp ret_from_sys_call +syscall_delay_hack: + SAVE_ALL + call syscall_delay + RESTORE_ALL + jmp ret_from_delay + /* Do syscall tracing */ tracesys: SAVE_REST diff -Napur -X /home/jbarnes/dontdiff linux-2.6.20/arch/x86_64/kernel/irq.c linux-2.6.20-delay-hack/arch/x86_64/kernel/irq.c --- linux-2.6.20/arch/x86_64/kernel/irq.c 2007-02-04 10:44:54.000000000 -0800 +++ linux-2.6.20-delay-hack/arch/x86_64/kernel/irq.c 2007-04-20 10:37:40.000000000 -0700 @@ -97,6 +97,16 @@ skip: return 0; } +static int irq_delay; + +static int __init irq_delay_hack(char *str) +{ + irq_delay = simple_strtol(str, NULL, 0); + return 1; +} +__setup("irq_delay=", irq_delay_hack); + + /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific @@ -110,6 +120,9 @@ asmlinkage unsigned int do_IRQ(struct pt unsigned vector = ~regs->orig_rax; unsigned irq; + /* IRQ delay hack to measure performance hit */ + ndelay(irq_delay); + exit_idle(); irq_enter(); irq = __get_cpu_var(vector_irq)[vector]; diff -Napur -X /home/jbarnes/dontdiff linux-2.6.20/arch/x86_64/kernel/setup.c linux-2.6.20-delay-hack/arch/x86_64/kernel/setup.c --- linux-2.6.20/arch/x86_64/kernel/setup.c 2007-02-04 10:44:54.000000000 -0800 +++ linux-2.6.20-delay-hack/arch/x86_64/kernel/setup.c 2007-04-20 11:10:35.000000000 -0700 @@ -1239,3 +1239,18 @@ static __init int add_pcspkr(void) } device_initcall(add_pcspkr); #endif + +static int syscall_delay_nsec; + +static int __init syscall_delay_hack(char *str) +{ + syscall_delay_nsec = simple_strtol(str, NULL, 0); + return 1; +} +__setup("syscall_delay=", syscall_delay_hack); + +void syscall_delay(void) +{ + ndelay(syscall_delay_nsec); +} + diff -Napur -X /home/jbarnes/dontdiff linux-2.6.20/Makefile linux-2.6.20-delay-hack/Makefile --- linux-2.6.20/Makefile 2007-02-04 10:44:54.000000000 -0800 +++ linux-2.6.20-delay-hack/Makefile 2007-04-20 11:07:28.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION = +EXTRAVERSION = -delay-hack NAME = Homicidal Dwarf Hamster # *DOCUMENTATION*