提交 44d93fd2 编写于 作者: M Mel Gorman 提交者: Zheng Zengkai

sched/numa: Rename nr_running and break out the magic number

mainline inclusion
from mainline-v5.11-rc1
commit abeae76a
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I40C8N
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abeae76a47005aa3f07c9be12d8076365622e25c

---------------------------

This is simply a preparation patch to make the following patches easier
to read. No functional change.
Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: NVincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20201120090630.3286-2-mgorman@techsingularity.netSigned-off-by: NZheng Zucheng <zhengzucheng@huawei.com>
Reviewed-by: NChen Hui <judy.chenhui@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e512cc33
......@@ -1565,7 +1565,7 @@ struct task_numa_env {
static unsigned long cpu_load(struct rq *rq);
static unsigned long cpu_runnable(struct rq *rq);
static unsigned long cpu_util(int cpu);
static inline long adjust_numa_imbalance(int imbalance, int nr_running);
static inline long adjust_numa_imbalance(int imbalance, int dst_running);
static inline enum
numa_type numa_classify(unsigned int imbalance_pct,
......@@ -9184,7 +9184,9 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
}
}
static inline long adjust_numa_imbalance(int imbalance, int nr_running)
#define NUMA_IMBALANCE_MIN 2
static inline long adjust_numa_imbalance(int imbalance, int dst_running)
{
unsigned int imbalance_min;
......@@ -9192,8 +9194,8 @@ static inline long adjust_numa_imbalance(int imbalance, int nr_running)
* Allow a small imbalance based on a simple pair of communicating
* tasks that remain local when the source domain is almost idle.
*/
imbalance_min = 2;
if (nr_running <= imbalance_min)
imbalance_min = NUMA_IMBALANCE_MIN;
if (dst_running <= imbalance_min)
return 0;
return imbalance;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部