Re: sched: allow resubmits to queue_balance_callback()

From: Peter Zijlstra
Date: Mon Mar 22 2021 - 06:43:24 EST


On Thu, Mar 18, 2021 at 03:57:34PM -0400, Barret Rhoden wrote:
> Prior to this commit, if you submitted the same callback_head twice, it
> would be enqueued twice, but only if it was the last callback on the
> list. The first time it was submitted, rq->balance_callback was NULL,
> so head->next is NULL. That defeated the check in
> queue_balance_callback().
>
> This commit changes the callback list such that whenever an item is on
> the list, its head->next is not NULL. The last element (first inserted)
> will point to itself. This allows us to detect and ignore any attempt
> to reenqueue a callback_head.
>
> Signed-off-by: Barret Rhoden <brho@xxxxxxxxxx>

AFAICT you're patching dead code, please check a current tree.