* [PATCH -next] sched/fair: Move update_nohz_stats() under CONFIG_NO_HZ_COMMON
@ 2021-03-30 12:06 Kefeng Wang
2021-03-30 12:22 ` Vincent Guittot
0 siblings, 1 reply; 3+ messages in thread
From: Kefeng Wang @ 2021-03-30 12:06 UTC (permalink / raw)
To: Peter Zijlstra, linux-kernel
Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Kefeng Wang
update_nohz_stats() only call _nohz_idle_balance() under CONFIG_NO_HZ_COMMON.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
kernel/sched/fair.c | 40 ++++++++++++++++++----------------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6d73bdbb2d40..2a20ada83cbb 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8395,28 +8395,6 @@ group_type group_classify(unsigned int imbalance_pct,
return group_has_spare;
}
-static bool update_nohz_stats(struct rq *rq)
-{
-#ifdef CONFIG_NO_HZ_COMMON
- unsigned int cpu = rq->cpu;
-
- if (!rq->has_blocked_load)
- return false;
-
- if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask))
- return false;
-
- if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick)))
- return true;
-
- update_blocked_averages(cpu);
-
- return rq->has_blocked_load;
-#else
- return false;
-#endif
-}
-
/**
* update_sg_lb_stats - Update sched_group's statistics for load balancing.
* @env: The load balancing environment.
@@ -10380,6 +10358,24 @@ void nohz_balance_enter_idle(int cpu)
WRITE_ONCE(nohz.has_blocked, 1);
}
+static bool update_nohz_stats(struct rq *rq)
+{
+ unsigned int cpu = rq->cpu;
+
+ if (!rq->has_blocked_load)
+ return false;
+
+ if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask))
+ return false;
+
+ if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick)))
+ return true;
+
+ update_blocked_averages(cpu);
+
+ return rq->has_blocked_load;
+}
+
/*
* Internal function that runs load balance for all idle cpus. The load balance
* can be a simple update of blocked load or a complete load balance with
--
2.26.2
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH -next] sched/fair: Move update_nohz_stats() under CONFIG_NO_HZ_COMMON
2021-03-30 12:06 [PATCH -next] sched/fair: Move update_nohz_stats() under CONFIG_NO_HZ_COMMON Kefeng Wang
@ 2021-03-30 12:22 ` Vincent Guittot
2021-03-30 12:27 ` Kefeng Wang
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Guittot @ 2021-03-30 12:22 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Peter Zijlstra, linux-kernel, Ingo Molnar, Juri Lelli
On Tue, 30 Mar 2021 at 14:06, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> update_nohz_stats() only call _nohz_idle_balance() under CONFIG_NO_HZ_COMMON.
a similar patch has already been sent and reviewed :
20210329144029.29200-1-yuehaibing@huawei.com
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> kernel/sched/fair.c | 40 ++++++++++++++++++----------------------
> 1 file changed, 18 insertions(+), 22 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6d73bdbb2d40..2a20ada83cbb 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8395,28 +8395,6 @@ group_type group_classify(unsigned int imbalance_pct,
> return group_has_spare;
> }
>
> -static bool update_nohz_stats(struct rq *rq)
> -{
> -#ifdef CONFIG_NO_HZ_COMMON
> - unsigned int cpu = rq->cpu;
> -
> - if (!rq->has_blocked_load)
> - return false;
> -
> - if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask))
> - return false;
> -
> - if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick)))
> - return true;
> -
> - update_blocked_averages(cpu);
> -
> - return rq->has_blocked_load;
> -#else
> - return false;
> -#endif
> -}
> -
> /**
> * update_sg_lb_stats - Update sched_group's statistics for load balancing.
> * @env: The load balancing environment.
> @@ -10380,6 +10358,24 @@ void nohz_balance_enter_idle(int cpu)
> WRITE_ONCE(nohz.has_blocked, 1);
> }
>
> +static bool update_nohz_stats(struct rq *rq)
> +{
> + unsigned int cpu = rq->cpu;
> +
> + if (!rq->has_blocked_load)
> + return false;
> +
> + if (!cpumask_test_cpu(cpu, nohz.idle_cpus_mask))
> + return false;
> +
> + if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick)))
> + return true;
> +
> + update_blocked_averages(cpu);
> +
> + return rq->has_blocked_load;
> +}
> +
> /*
> * Internal function that runs load balance for all idle cpus. The load balance
> * can be a simple update of blocked load or a complete load balance with
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH -next] sched/fair: Move update_nohz_stats() under CONFIG_NO_HZ_COMMON
2021-03-30 12:22 ` Vincent Guittot
@ 2021-03-30 12:27 ` Kefeng Wang
0 siblings, 0 replies; 3+ messages in thread
From: Kefeng Wang @ 2021-03-30 12:27 UTC (permalink / raw)
To: Vincent Guittot; +Cc: Peter Zijlstra, linux-kernel, Ingo Molnar, Juri Lelli
On 2021/3/30 20:22, Vincent Guittot wrote:
> On Tue, 30 Mar 2021 at 14:06, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> update_nohz_stats() only call _nohz_idle_balance() under CONFIG_NO_HZ_COMMON.
> a similar patch has already been sent and reviewed :
> 20210329144029.29200-1-yuehaibing@huawei.com
ok please ignore it.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-30 12:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 12:06 [PATCH -next] sched/fair: Move update_nohz_stats() under CONFIG_NO_HZ_COMMON Kefeng Wang
2021-03-30 12:22 ` Vincent Guittot
2021-03-30 12:27 ` Kefeng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®