Re: [PATCH v2 5/7] sched: Implement shared runqueue in CFS
From: Aaron Lu
Date: Thu Jul 13 2023 - 04:00:51 EST
On Mon, Jul 10, 2023 at 03:03:40PM -0500, David Vernet wrote:
> static void shared_runq_dequeue_task(struct task_struct *p)
> -{}
> +{
> + unsigned long flags;
> + struct shared_runq *shared_runq;
> +
> + if (!list_empty(&p->shared_runq_node)) {
> + shared_runq = rq_shared_runq(task_rq(p));
> + spin_lock_irqsave(&shared_runq->lock, flags);
After taking the lock, p may have been poped by another newidle cpu.
Running list_del_init() doesn't seem hurt, but is this intended?
> + list_del_init(&p->shared_runq_node);
> + spin_unlock_irqrestore(&shared_runq->lock, flags);
> + }
> +}