diff options
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3bdf01b494fe..7f3063c153d8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -684,10 +684,16 @@ static void wake_up_idle_cpu(int cpu) | |||
684 | 684 | ||
685 | static bool wake_up_full_nohz_cpu(int cpu) | 685 | static bool wake_up_full_nohz_cpu(int cpu) |
686 | { | 686 | { |
687 | /* | ||
688 | * We just need the target to call irq_exit() and re-evaluate | ||
689 | * the next tick. The nohz full kick at least implies that. | ||
690 | * If needed we can still optimize that later with an | ||
691 | * empty IRQ. | ||
692 | */ | ||
687 | if (tick_nohz_full_cpu(cpu)) { | 693 | if (tick_nohz_full_cpu(cpu)) { |
688 | if (cpu != smp_processor_id() || | 694 | if (cpu != smp_processor_id() || |
689 | tick_nohz_tick_stopped()) | 695 | tick_nohz_tick_stopped()) |
690 | smp_send_reschedule(cpu); | 696 | tick_nohz_full_kick_cpu(cpu); |
691 | return true; | 697 | return true; |
692 | } | 698 | } |
693 | 699 | ||
@@ -734,10 +740,11 @@ bool sched_can_stop_tick(void) | |||
734 | 740 | ||
735 | rq = this_rq(); | 741 | rq = this_rq(); |
736 | 742 | ||
737 | /* Make sure rq->nr_running update is visible after the IPI */ | 743 | /* |
738 | smp_rmb(); | 744 | * More than one running task need preemption. |
739 | 745 | * nr_running update is assumed to be visible | |
740 | /* More than one running task need preemption */ | 746 | * after IPI is sent from wakers. |
747 | */ | ||
741 | if (rq->nr_running > 1) | 748 | if (rq->nr_running > 1) |
742 | return false; | 749 | return false; |
743 | 750 | ||
@@ -1568,9 +1575,7 @@ void scheduler_ipi(void) | |||
1568 | */ | 1575 | */ |
1569 | preempt_fold_need_resched(); | 1576 | preempt_fold_need_resched(); |
1570 | 1577 | ||
1571 | if (llist_empty(&this_rq()->wake_list) | 1578 | if (llist_empty(&this_rq()->wake_list) && !got_nohz_idle_kick()) |
1572 | && !tick_nohz_full_cpu(smp_processor_id()) | ||
1573 | && !got_nohz_idle_kick()) | ||
1574 | return; | 1579 | return; |
1575 | 1580 | ||
1576 | /* | 1581 | /* |
@@ -1587,7 +1592,6 @@ void scheduler_ipi(void) | |||
1587 | * somewhat pessimize the simple resched case. | 1592 | * somewhat pessimize the simple resched case. |
1588 | */ | 1593 | */ |
1589 | irq_enter(); | 1594 | irq_enter(); |
1590 | tick_nohz_full_check(); | ||
1591 | sched_ttwu_pending(); | 1595 | sched_ttwu_pending(); |
1592 | 1596 | ||
1593 | /* | 1597 | /* |