Skip to content

Commit

Permalink
sched/alt: Fix task migratie to dying cpu.
Browse files Browse the repository at this point in the history
Fix zen-kernel#23

WARNING: CPU: 2 PID: 26 at kernel/sched/alt_core.c:6294
sched_cpu_dying.cold+0xc/0xd2
  • Loading branch information
cchalpha committed Apr 24, 2023
1 parent aeece0d commit 0d72400
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kernel/sched/alt_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ static inline int select_task_rq(struct task_struct *p, struct rq *rq)
{
cpumask_t chk_mask, tmp;

if (unlikely(!cpumask_and(&chk_mask, p->cpus_ptr, cpu_online_mask)))
if (unlikely(!cpumask_and(&chk_mask, p->cpus_ptr, cpu_active_mask)))
return select_fallback_rq(task_cpu(p), p);

if (
Expand Down Expand Up @@ -3420,6 +3420,10 @@ static inline void sg_balance_check(struct rq *rq)
if (cpumask_empty(&sched_sg_idle_mask))
return;

/* exit when cpu is offline */
if (unlikely(!rq->online))
return;

cpu = cpu_of(rq);
/*
* Only cpu in slibing idle group will do the checking and then
Expand Down

0 comments on commit 0d72400

Please sign in to comment.