aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/time/tick-sched.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 95d79aeb3e27..d0ed1905a85c 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -647,6 +647,24 @@ out:
647 return ret; 647 return ret;
648} 648}
649 649
650static void tick_nohz_full_stop_tick(struct tick_sched *ts)
651{
652#ifdef CONFIG_NO_HZ_FULL
653 int cpu = smp_processor_id();
654
655 if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))
656 return;
657
658 if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)
659 return;
660
661 if (!can_stop_full_tick())
662 return;
663
664 tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);
665#endif
666}
667
650static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) 668static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
651{ 669{
652 /* 670 /*
@@ -773,12 +791,13 @@ void tick_nohz_irq_exit(void)
773{ 791{
774 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); 792 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
775 793
776 if (!ts->inidle) 794 if (ts->inidle) {
777 return; 795 /* Cancel the timer because CPU already waken up from the C-states*/
778 796 menu_hrtimer_cancel();
779 /* Cancel the timer because CPU already waken up from the C-states*/ 797 __tick_nohz_idle_enter(ts);
780 menu_hrtimer_cancel(); 798 } else {
781 __tick_nohz_idle_enter(ts); 799 tick_nohz_full_stop_tick(ts);
800 }
782} 801}
783 802
784/** 803/**