mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
48c08d3f8f
commit
4866cde064
9 changed files with 131 additions and 97 deletions
|
@ -422,16 +422,10 @@ extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
|
|||
extern int stop_a_enabled;
|
||||
|
||||
/*
|
||||
* Taken from include/asm-ia64/system.h; prevents deadlock on SMP
|
||||
* See include/asm-ia64/system.h; prevents deadlock on SMP
|
||||
* systems.
|
||||
*/
|
||||
#define prepare_arch_switch(rq, next) \
|
||||
do { \
|
||||
spin_lock(&(next)->switch_lock); \
|
||||
spin_unlock(&(rq)->lock); \
|
||||
} while (0)
|
||||
#define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock)
|
||||
#define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
|
||||
#define __ARCH_WANT_UNLOCKED_CTXSW
|
||||
|
||||
#define arch_align_stack(x) (x)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue