Re: [PATCH v2 08/10] sched/fair: Add newidle balance to pick_task_fair()
From: K Prateek Nayak
Date: Tue May 12 2026 - 01:45:50 EST
Hello Peter,
On 5/11/2026 5:01 PM, Peter Zijlstra wrote:
> @@ -9245,6 +9247,14 @@ static struct task_struct *pick_task_fai
> if (unlikely(throttled))
> task_throttle_setup_work(p);
> return p;
> +
> +idle:
> + new_tasks = sched_balance_newidle(rq, rf);
> + if (new_tasks < 0)
> + return RETRY_TASK;
> + if (new_tasks > 0)
> + goto again;
> + return NULL;
> }
For core scheduling will now trigger a newidle balance during the pick
when core_cookie is reset to 0 which can cause tasks to migrate only
for them to find they cannot run on the CPU since core-wide selection
leads to a cookie mismatch and it is kept hanging there.
Can we return early if sched_core_enabled() here or are the additional
newidle balance okay?
--
Thanks and Regards,
Prateek