diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-02-18 02:53:19 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-03-30 02:36:02 -0400 |
commit | 2829b449276aed45f3d649efb21e3418e39dd5d1 (patch) | |
tree | eb16821bc9ad330f8c2f289510603ca528feaeae /arch/x86/kernel/paravirt.c | |
parent | 224101ed69d3fbb486868e0f6e0f9fa37302efb4 (diff) |
x86/paravirt: allow preemption with lazy mmu mode
Impact: remove obsolete checks, simplification
Lift restrictions on preemption with lazy mmu mode, as it is now allowed.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'arch/x86/kernel/paravirt.c')
-rw-r--r-- | arch/x86/kernel/paravirt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index cf1437503bab..bf2e86eee80c 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -247,7 +247,6 @@ static DEFINE_PER_CPU(enum paravirt_lazy_mode, paravirt_lazy_mode) = PARAVIRT_LA | |||
247 | static inline void enter_lazy(enum paravirt_lazy_mode mode) | 247 | static inline void enter_lazy(enum paravirt_lazy_mode mode) |
248 | { | 248 | { |
249 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE); | 249 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE); |
250 | BUG_ON(preemptible()); | ||
251 | 250 | ||
252 | __get_cpu_var(paravirt_lazy_mode) = mode; | 251 | __get_cpu_var(paravirt_lazy_mode) = mode; |
253 | } | 252 | } |
@@ -255,7 +254,6 @@ static inline void enter_lazy(enum paravirt_lazy_mode mode) | |||
255 | static void leave_lazy(enum paravirt_lazy_mode mode) | 254 | static void leave_lazy(enum paravirt_lazy_mode mode) |
256 | { | 255 | { |
257 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != mode); | 256 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != mode); |
258 | BUG_ON(preemptible()); | ||
259 | 257 | ||
260 | __get_cpu_var(paravirt_lazy_mode) = PARAVIRT_LAZY_NONE; | 258 | __get_cpu_var(paravirt_lazy_mode) = PARAVIRT_LAZY_NONE; |
261 | } | 259 | } |
@@ -272,6 +270,8 @@ void paravirt_leave_lazy_mmu(void) | |||
272 | 270 | ||
273 | void paravirt_start_context_switch(struct task_struct *prev) | 271 | void paravirt_start_context_switch(struct task_struct *prev) |
274 | { | 272 | { |
273 | BUG_ON(preemptible()); | ||
274 | |||
275 | if (percpu_read(paravirt_lazy_mode) == PARAVIRT_LAZY_MMU) { | 275 | if (percpu_read(paravirt_lazy_mode) == PARAVIRT_LAZY_MMU) { |
276 | arch_leave_lazy_mmu_mode(); | 276 | arch_leave_lazy_mmu_mode(); |
277 | set_ti_thread_flag(task_thread_info(prev), TIF_LAZY_MMU_UPDATES); | 277 | set_ti_thread_flag(task_thread_info(prev), TIF_LAZY_MMU_UPDATES); |
@@ -281,6 +281,8 @@ void paravirt_start_context_switch(struct task_struct *prev) | |||
281 | 281 | ||
282 | void paravirt_end_context_switch(struct task_struct *next) | 282 | void paravirt_end_context_switch(struct task_struct *next) |
283 | { | 283 | { |
284 | BUG_ON(preemptible()); | ||
285 | |||
284 | leave_lazy(PARAVIRT_LAZY_CPU); | 286 | leave_lazy(PARAVIRT_LAZY_CPU); |
285 | 287 | ||
286 | if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES)) | 288 | if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES)) |
@@ -300,7 +302,6 @@ void arch_flush_lazy_mmu_mode(void) | |||
300 | preempt_disable(); | 302 | preempt_disable(); |
301 | 303 | ||
302 | if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) { | 304 | if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) { |
303 | WARN_ON(preempt_count() == 1); | ||
304 | arch_leave_lazy_mmu_mode(); | 305 | arch_leave_lazy_mmu_mode(); |
305 | arch_enter_lazy_mmu_mode(); | 306 | arch_enter_lazy_mmu_mode(); |
306 | } | 307 | } |