diff options
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 7b816daf3eba..3ec4ca40ff5f 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -304,6 +304,10 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
304 | struct thread_struct *new_thread, *old_thread; | 304 | struct thread_struct *new_thread, *old_thread; |
305 | unsigned long flags; | 305 | unsigned long flags; |
306 | struct task_struct *last; | 306 | struct task_struct *last; |
307 | #if defined(CONFIG_PPC64) && defined (CONFIG_PREEMPT_RT) | ||
308 | struct ppc64_tlb_batch *batch; | ||
309 | int hadbatch; | ||
310 | #endif | ||
307 | 311 | ||
308 | #ifdef CONFIG_SMP | 312 | #ifdef CONFIG_SMP |
309 | /* avoid complexity of lazy save/restore of fpu | 313 | /* avoid complexity of lazy save/restore of fpu |
@@ -396,6 +400,17 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
396 | old_thread->accum_tb += (current_tb - start_tb); | 400 | old_thread->accum_tb += (current_tb - start_tb); |
397 | new_thread->start_tb = current_tb; | 401 | new_thread->start_tb = current_tb; |
398 | } | 402 | } |
403 | |||
404 | #ifdef CONFIG_PREEMPT_RT | ||
405 | batch = &__get_cpu_var(ppc64_tlb_batch); | ||
406 | if (batch->active) { | ||
407 | hadbatch = 1; | ||
408 | if (batch->index) { | ||
409 | __flush_tlb_pending(batch); | ||
410 | } | ||
411 | batch->active = 0; | ||
412 | } | ||
413 | #endif /* #ifdef CONFIG_PREEMPT_RT */ | ||
399 | #endif | 414 | #endif |
400 | 415 | ||
401 | local_irq_save(flags); | 416 | local_irq_save(flags); |
@@ -414,6 +429,13 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
414 | 429 | ||
415 | local_irq_restore(flags); | 430 | local_irq_restore(flags); |
416 | 431 | ||
432 | #if defined(CONFIG_PPC64) && defined(CONFIG_PREEMPT_RT) | ||
433 | if (hadbatch) { | ||
434 | batch = &__get_cpu_var(ppc64_tlb_batch); | ||
435 | batch->active = 1; | ||
436 | } | ||
437 | #endif | ||
438 | |||
417 | return last; | 439 | return last; |
418 | } | 440 | } |
419 | 441 | ||