public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] sched: Update cpu_load before nohz ilb
@ 2014-02-20 22:06 Sai
  2014-02-21 20:44 ` Sai
  0 siblings, 1 reply; 2+ messages in thread
From: Sai @ 2014-02-20 22:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo

Update the cpu_load of the kickee in run_rebalance_domains before
calling rebalance_domains if the kickee is in nohz_idle. This avoids
using stale cpu_load for the subsequent load_balance.

cpu_load in the nohz path is updated on tick_nohz_idle_exit or if a
kickee performances balancing on the behalf of tickless cpus in
nohz_idle_balance. However, the kickee's cpu_load is never updated if it
doesn't exit nohz_idle. This causes stale cpu_load to be used which
causes incorrect load balancing decisions.

Tested on k3.10.

Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
---
 kernel/sched/fair.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 860a152..1d4eb4a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7140,6 +7140,13 @@ static void run_rebalance_domains(struct
softirq_action *h)
        enum cpu_idle_type idle = this_rq->idle_balance ?
                                                CPU_IDLE : CPU_NOT_IDLE;

+       if (test_bit(NOHZ_BALANCE_KICK, nohz_flags(this_rq->cpu))) {
+               raw_spin_lock_irq(&this_rq->lock);
+               update_rq_clock(this_rq);
+               update_idle_cpu_load(this_rq);
+               raw_spin_unlock_irq(&this_rq->lock);
+       }
+
        rebalance_domains(this_rq, idle);

        /*
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] sched: Update cpu_load before nohz ilb
  2014-02-20 22:06 [RFC PATCH] sched: Update cpu_load before nohz ilb Sai
@ 2014-02-21 20:44 ` Sai
  0 siblings, 0 replies; 2+ messages in thread
From: Sai @ 2014-02-21 20:44 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: peterz@infradead.org, mingo@redhat.com, pboonstoppel, pwalmsley,
	fweisbec

+ More people.

On 02/20/2014 02:06 PM, Sai wrote:
> Update the cpu_load of the kickee in run_rebalance_domains before
> calling rebalance_domains if the kickee is in nohz_idle. This avoids
> using stale cpu_load for the subsequent load_balance.
> 
> cpu_load in the nohz path is updated on tick_nohz_idle_exit or if a
> kickee performances balancing on the behalf of tickless cpus in
> nohz_idle_balance. However, the kickee's cpu_load is never updated if it
> doesn't exit nohz_idle. This causes stale cpu_load to be used which
> causes incorrect load balancing decisions.
> 
> Tested on k3.10.
> 
> Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
> ---
>  kernel/sched/fair.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 860a152..1d4eb4a 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7140,6 +7140,13 @@ static void run_rebalance_domains(struct
> softirq_action *h)
>         enum cpu_idle_type idle = this_rq->idle_balance ?
>                                                 CPU_IDLE : CPU_NOT_IDLE;
> 
> +       if (test_bit(NOHZ_BALANCE_KICK, nohz_flags(this_rq->cpu))) {
> +               raw_spin_lock_irq(&this_rq->lock);
> +               update_rq_clock(this_rq);
> +               update_idle_cpu_load(this_rq);
> +               raw_spin_unlock_irq(&this_rq->lock);
> +       }
> +
>         rebalance_domains(this_rq, idle);
> 
>         /*
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-21 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 22:06 [RFC PATCH] sched: Update cpu_load before nohz ilb Sai
2014-02-21 20:44 ` Sai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox