Re: [PATCH v23 2/9] sched: Fix modifying donor->blocked on without proper locking
From: K Prateek Nayak
Date: Thu Oct 30 2025 - 00:51:18 EST
Hello John,
On 10/30/2025 5:48 AM, John Stultz wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 517b26c515bc5..0533a14ce5935 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6591,7 +6591,7 @@ static struct task_struct *proxy_deactivate(struct rq *rq, struct task_struct *d
> * as unblocked, as we aren't doing proxy-migrations
> * yet (more logic will be needed then).
> */
> - donor->blocked_on = NULL;
> + clear_task_blocked_on(donor, NULL);
nit. You can probably switch this to use __clear_task_blocked_on() in
the previous patch and then to the clear_task_blocked_on() variant here.
It makes it more clear that proxy_deactivate() is now out of the
"donor->blocked_lock" critical section.
Either way, no strong feelings.
> }
> return NULL;
> }
> @@ -6619,6 +6619,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
> int this_cpu = cpu_of(rq);
> struct task_struct *p;
> struct mutex *mutex;
> + enum { FOUND, DEACTIVATE_DONOR } action = FOUND;
nit. If you move that declaration to the top, you can preserve the nice
reverse xmas arrangement ;)
Apart from those couple of nits, feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
--
Thanks and Regards,
Prateek