public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	schatzberg.dan@gmail.com, mingo@redhat.com, peterz@infradead.org,
	changwoo@igalia.com, righi.andrea@gmail.com
Subject: Re: [PATCH 3/6] sched_ext: Unpin and repin rq lock from balance_scx()
Date: Wed, 10 Jul 2024 21:05:04 -0500	[thread overview]
Message-ID: <20240711020504.GG317151@maniforge> (raw)
In-Reply-To: <20240711011434.1421572-4-tj@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On Wed, Jul 10, 2024 at 03:14:00PM -1000, Tejun Heo wrote:
> sched_ext often needs to migrate tasks across CPUs right before execution
> and thus uses the balance path to dispatch tasks from the BPF scheduler.
> balance_scx() is called with rq locked and pinned but is passed @rf and thus
> allowed to unpin and unlock. Currently, @rf is passed down the call stack so
> the rq lock is unpinned just when double locking is needed.
> 
> This creates unnecessary complications such as having to explicitly
> manipulate lock pinning for core scheduling. We also want to use
> dispatch_to_local_dsq_lock() from other paths which are called with rq
> locked but unpinned.
> 
> rq lock handling in the dispatch path is straightforward outside the
> migration implementation and extending the pinning protection down the
> callstack doesn't add enough meaningful extra protection to justify the
> extra complexity.
> 
> Unpin and repin rq lock from the outer balance_scx() and drop @rf passing
> and lock pinning handling from the inner functions. UP is updated to call
> balance_one() instead of balance_scx() to avoid adding NULL @rf handling to
> balance_scx(). AS this makes balance_scx() unused in UP, it's put inside a
> CONFIG_SMP block.
> 
> No functional changes intended outside of lock annotation updates.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Andrea Righi <righi.andrea@gmail.com>
> Cc: David Vernet <void@manifault.com>

Acked-by: David Vernet <void@manifault.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-07-11  2:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  1:13 [PATCHSET v2 sched_ext/for-6.11] sched_ext: Allow SCX_DSQ_LOCAL_ON for direct dispatches Tejun Heo
2024-07-11  1:13 ` [PATCH 1/6] sched: Move struct balance_callback definition upward Tejun Heo
2024-07-11 21:06   ` Tejun Heo
2024-07-11  1:13 ` [PATCH 2/6] sched_ext: Open-code task_linked_on_dsq() Tejun Heo
2024-07-11  1:14 ` [PATCH 3/6] sched_ext: Unpin and repin rq lock from balance_scx() Tejun Heo
2024-07-11  2:05   ` David Vernet [this message]
2024-07-11  1:14 ` [PATCH 4/6] sched_ext: s/SCX_RQ_BALANCING/SCX_RQ_IN_BALANCE/ and add SCX_RQ_IN_WAKEUP Tejun Heo
2024-07-11  1:14 ` [PATCH 5/6] sched_ext: Allow SCX_DSQ_LOCAL_ON for direct dispatches Tejun Heo
2024-07-11  2:05   ` David Vernet
2024-07-11  1:14 ` [PATCH 6/6] sched_ext/scx_qmap: Pick idle CPU for direct dispatch on !wakeup enqueues Tejun Heo
2024-07-12 18:22 ` [PATCHSET v2 sched_ext/for-6.11] sched_ext: Allow SCX_DSQ_LOCAL_ON for direct dispatches 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=20240711020504.GG317151@maniforge \
    --to=void@manifault.com \
    --cc=changwoo@igalia.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=righi.andrea@gmail.com \
    --cc=schatzberg.dan@gmail.com \
    --cc=tj@kernel.org \
    /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