Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tile: Remove finish_arch_switch

Move the simulator bits into switch_to() and use
finish_arch_post_lock_switch() for the homecache migration bits.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>

+8 -5
+3 -5
arch/tile/include/asm/switch_to.h
··· 53 53 * Kernel threads can check to see if they need to migrate their 54 54 * stack whenever they return from a context switch; for user 55 55 * threads, we defer until they are returning to user-space. 56 + * We defer homecache migration until the runqueue lock is released. 56 57 */ 57 - #define finish_arch_switch(prev) do { \ 58 - if (unlikely((prev)->state == TASK_DEAD)) \ 59 - __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_EXIT | \ 60 - ((prev)->pid << _SIM_CONTROL_OPERATOR_BITS)); \ 58 + #define finish_arch_post_lock_switch() do { \ 61 59 __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_SWITCH | \ 62 60 (current->pid << _SIM_CONTROL_OPERATOR_BITS)); \ 63 61 if (current->mm == NULL && !kstack_hash && \ 64 - current_thread_info()->homecache_cpu != smp_processor_id()) \ 62 + current_thread_info()->homecache_cpu != raw_smp_processor_id()) \ 65 63 homecache_migrate_kthread(); \ 66 64 } while (0) 67 65
+5
arch/tile/kernel/process.c
··· 446 446 hardwall_switch_tasks(prev, next); 447 447 #endif 448 448 449 + /* Notify the simulator of task exit. */ 450 + if (unlikely(prev->state == TASK_DEAD)) 451 + __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_EXIT | 452 + (prev->pid << _SIM_CONTROL_OPERATOR_BITS)); 453 + 449 454 /* 450 455 * Switch kernel SP, PC, and callee-saved registers. 451 456 * In the context of the new task, return the old task pointer