diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2005-06-25 17:57:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:43 -0400 |
commit | 4866cde064afbb6c2a488c265e696879de616daa (patch) | |
tree | 6effad1ab6271129fc607b98273086409876563a /include/asm-mips/system.h | |
parent | 48c08d3f8ff94fa118187e4d8d4a5707bb85e59d (diff) |
[PATCH] sched: cleanup context switch locking
Instead of requiring architecture code to interact with the scheduler's
locking implementation, provide a couple of defines that can be used by the
architecture to request runqueue unlocked context switches, and ask for
interrupts to be enabled over the context switch.
Also replaces the "switch_lock" used by these architectures with an oncpu
flag (note, not a potentially slow bitflag). This eliminates one bus
locked memory operation when context switching, and simplifies the
task_running function.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-mips/system.h')
-rw-r--r-- | include/asm-mips/system.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 888fd8908467..169f3d4265b1 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -422,16 +422,10 @@ extern void __die_if_kernel(const char *, struct pt_regs *, const char *file, | |||
422 | extern int stop_a_enabled; | 422 | extern int stop_a_enabled; |
423 | 423 | ||
424 | /* | 424 | /* |
425 | * Taken from include/asm-ia64/system.h; prevents deadlock on SMP | 425 | * See include/asm-ia64/system.h; prevents deadlock on SMP |
426 | * systems. | 426 | * systems. |
427 | */ | 427 | */ |
428 | #define prepare_arch_switch(rq, next) \ | 428 | #define __ARCH_WANT_UNLOCKED_CTXSW |
429 | do { \ | ||
430 | spin_lock(&(next)->switch_lock); \ | ||
431 | spin_unlock(&(rq)->lock); \ | ||
432 | } while (0) | ||
433 | #define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock) | ||
434 | #define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock)) | ||
435 | 429 | ||
436 | #define arch_align_stack(x) (x) | 430 | #define arch_align_stack(x) (x) |
437 | 431 | ||