Commit c5ce59ba authored by zhangwei123171's avatar zhangwei123171
Browse files

sched/fair: skip smt expel when cpu down

jingdong inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I86JWB



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

1. smt expel IPI is not needed for a dying cpu.

2. pick_next_task_fair cannot return NULL due to the smt expel
function during cpu down handler. Affects the migration of tasks.

Fixes: fd5207be ("sched: Implement the function of qos smt expeller")
Fixes: e4108f66 ("sched/fair: Introduce QOS_SMT_EXPELL priority reversion mechanism")
Signed-off-by: default avatarzhangwei123171 <zhangwei123171@jd.com>
Reviewed-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent f41354b6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -8163,6 +8163,9 @@ static void qos_smt_send_ipi(int this_cpu)

		rq = cpu_rq(cpu);

		if (unlikely(!rq->online))
			continue;

		/*
		 * There are two cases where current don't need to send
		 * scheduler_ipi:
@@ -8301,7 +8304,7 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf

again:
#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
	if (qos_smt_expelled(this_cpu) && !__this_cpu_read(qos_cpu_overload)) {
	if (rq->online && qos_smt_expelled(this_cpu) && !__this_cpu_read(qos_cpu_overload)) {
		__this_cpu_write(qos_smt_status, CPU_SMT_EXPELLED);

		if (!qos_timer_is_activated(this_cpu))