aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/system.h
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2005-06-25 17:57:23 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:43 -0400
commit4866cde064afbb6c2a488c265e696879de616daa (patch)
tree6effad1ab6271129fc607b98273086409876563a /include/asm-s390/system.h
parent48c08d3f8ff94fa118187e4d8d4a5707bb85e59d (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-s390/system.h')
-rw-r--r--include/asm-s390/system.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index e3cb3ce1d24a..b4a9f05a93d6 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -104,29 +104,18 @@ static inline void restore_access_regs(unsigned int *acrs)
104 prev = __switch_to(prev,next); \ 104 prev = __switch_to(prev,next); \
105} while (0) 105} while (0)
106 106
107#define prepare_arch_switch(rq, next) do { } while(0)
108#define task_running(rq, p) ((rq)->curr == (p))
109
110#ifdef CONFIG_VIRT_CPU_ACCOUNTING 107#ifdef CONFIG_VIRT_CPU_ACCOUNTING
111extern void account_user_vtime(struct task_struct *); 108extern void account_user_vtime(struct task_struct *);
112extern void account_system_vtime(struct task_struct *); 109extern void account_system_vtime(struct task_struct *);
113
114#define finish_arch_switch(rq, prev) do { \
115 set_fs(current->thread.mm_segment); \
116 spin_unlock(&(rq)->lock); \
117 account_system_vtime(prev); \
118 local_irq_enable(); \
119} while (0)
120
121#else 110#else
111#define account_system_vtime(prev) do { } while (0)
112#endif
122 113
123#define finish_arch_switch(rq, prev) do { \ 114#define finish_arch_switch(rq, prev) do { \
124 set_fs(current->thread.mm_segment); \ 115 set_fs(current->thread.mm_segment); \
125 spin_unlock_irq(&(rq)->lock); \ 116 account_system_vtime(prev); \
126} while (0) 117} while (0)
127 118
128#endif
129
130#define nop() __asm__ __volatile__ ("nop") 119#define nop() __asm__ __volatile__ ("nop")
131 120
132#define xchg(ptr,x) \ 121#define xchg(ptr,x) \