mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] sched/core: Avoid requeueing a singleton balance callback
Date: Wed, 21 Oct 2026 07:37:16 +0200	[thread overview]
Message-ID: <athPjBvCLvIILiKL@gpd4> (raw)
In-Reply-To: <61d3176fb616261d1571449114fd9f67@kernel.org>

Hi Tejun,

On Tue, Oct 20, 2026 at 08:20:25AM -1000, Tejun Heo wrote:
> Hello, Andrea.
> 
> On Tue, Oct 20, 2026 at 10:43:19AM +0200, Andrea Righi wrote:
> > When the callback is the only list entry, its next pointer is NULL, so
> > the existing duplicate check misses it. Queueing it again links it to
> > itself and causes the wait to run twice.
> 
> The last entry of a longer list has the same problem. Its next is NULL
> and it isn't rq->balance_callback, so it can be queued again:
> 
> 1. A is queued on an empty list. A->next is NULL.
> 2. B is queued. The list is B -> A.
> 3. A is queued again. A->next = B and the list becomes A -> B -> A.
> 
> do_balance_callbacks() then runs A twice. This doesn't affect
> kick_sync_bal_cb, as nothing gets queued between the SNT_REPICK and
> SNT_PICK calls.

Ah yes, thanks for pointing that out. Agreed, the head check only covers
the singleton case, but the tail-entry case remains.

I'll keep this fix scoped to the reported issue and address the
duplicate detection for a separate follow-up with Peter.

Thanks,
-Andrea

  reply	other threads:[~2026-10-21  5:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  8:43 [PATCHSET sched_ext/for-7.4-fixes] sched_ext: Fix proxy execution balance callbacks Andrea Righi
2026-10-20  8:43 ` [PATCH 1/3] sched/core: Avoid requeueing a singleton balance callback Andrea Righi
2026-10-20 17:57   ` Tejun Heo
2026-10-20 18:20   ` Tejun Heo
2026-10-21  5:37     ` Andrea Righi [this message]
2026-10-20  8:43 ` [PATCH 2/3] sched_ext: Use irq_work for deferred actions with proxy execution Andrea Righi
2026-10-20 18:20   ` Tejun Heo
2026-10-20  8:43 ` [PATCH 3/3] sched_ext: Remove the foreign CPU check from the kick_sync wait Andrea Righi
2026-10-20 18:20   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=athPjBvCLvIILiKL@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®