Use per-cpu var cpumask_weight_sibling for quick lookup in select_idle_cpu.
This is the fast path of scheduler and every cycle is worth saving. Usage
of cpumask_weight can result in iterations.

Signed-off-by: subhra mazumdar <subhra.mazum...@oracle.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6a74808..878f11c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6206,7 +6206,7 @@ static int select_idle_cpu(struct task_struct *p, struct 
sched_domain *sd, int t
 
        if (sched_feat(SIS_PROP)) {
                u64 span_avg = sd->span_weight * avg_idle;
-               floor = cpumask_weight(topology_sibling_cpumask(target));
+               floor = topology_sibling_weight(target);
                if (floor < 2)
                        floor = 2;
                limit = floor << 1;
-- 
2.9.3

Reply via email to