From: Mikael Pettersson - Move perfctr_suspend_thread() call from __switch_to() to the beginning of switch_to(). Ensures that suspend actions are done when the owner task still is 'current'. Signed-off-by: Mikael Pettersson Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/process.c | 2 -- 25-akpm/include/asm-i386/system.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff -puN arch/i386/kernel/process.c~perfctr-x86-core-updates arch/i386/kernel/process.c --- 25/arch/i386/kernel/process.c~perfctr-x86-core-updates 2005-01-23 14:46:56.774687488 -0800 +++ 25-akpm/arch/i386/kernel/process.c 2005-01-23 14:46:56.779686728 -0800 @@ -591,8 +591,6 @@ struct task_struct fastcall * __switch_t /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ - perfctr_suspend_thread(prev); - __unlazy_fpu(prev_p); /* diff -puN include/asm-i386/system.h~perfctr-x86-core-updates include/asm-i386/system.h --- 25/include/asm-i386/system.h~perfctr-x86-core-updates 2005-01-23 14:46:56.775687336 -0800 +++ 25-akpm/include/asm-i386/system.h 2005-01-23 14:46:56.779686728 -0800 @@ -14,6 +14,7 @@ extern struct task_struct * FASTCALL(__s #define switch_to(prev,next,last) do { \ unsigned long esi,edi; \ + perfctr_suspend_thread(&(prev)->thread); \ asm volatile("pushfl\n\t" \ "pushl %%ebp\n\t" \ "movl %%esp,%0\n\t" /* save ESP */ \ _