All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>,
	David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>
Cc: John Stultz <jstultz@google.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 sched_ext/for-7.4] sched_ext: Keep proxy donors with slice left on the local DSQ
Date: Wed, 14 Oct 2026 12:10:44 -1000	[thread overview]
Message-ID: <1548cc9309a6e0894e358262e0b3d4ee@kernel.org> (raw)
In-Reply-To: <5b3d2c576222c62738b7006d85f96a23@kernel.org>

Hello, Andrea.

The following is a Claude-generated review.

Two issues found while going through the patch. Both are from reading
the code and neither has been reproduced.

SCX_RQ_PROXY_PENDING can stay set into a core-sched forced idle:

1. A blocked donor is picked and set_next_task_scx() sets the flag.

2. find_proxy_task() returns NULL without putting the donor because
   blocked_on changed or the owner moved, and __schedule() goes to
   pick_again.

3. On the core-sched path, a fair or RT task wins pick_task() on this
   rq, so pick_task_scx() does not run and the flag is not cleared.

4. The cookie does not match and the CPU is forced idle.
   put_prev_set_next_task(rq, donor, idle) sees the flag and
   put_prev_task_scx() takes it as a bookkeeping put.

An IMMED donor then stays on the local DSQ through the forced idle, and
a donor without slice goes to ops.enqueue() without SCX_ENQ_LAST. Maybe
clear the flag when find_proxy_task() abandons the pick?

On an IMMED bookkeeping put, the local DSQ insert always queues a reenq
scan from dsq_inc_nr(). rq->next_class is still ext there, as
proxy_resched_idle() lowers it to idle only after the put, so
rq_is_open() is false. The scan is a no-op once the CPU is in idle.

However, if an SCX task wakes up on the CPU before the scan runs, the
wakeup raises rq->next_class back to ext and task_woken_scx() runs the
pending scan, which sees the rq closed and sends the donor back to BPF.
That is the ops.enqueue() round trip the patch is meant to remove. Can
you take a look?

Thanks.

-- 
tejun

      reply	other threads:[~2026-10-14 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10  9:06 [PATCH v4 sched_ext/for-7.4] sched_ext: Keep proxy donors with slice left on the local DSQ Andrea Righi
2026-10-14 21:50 ` Tejun Heo
2026-10-14 22:10   ` Tejun Heo [this message]

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=1548cc9309a6e0894e358262e0b3d4ee@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.