lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240711020504.GG317151@maniforge>
Date: Wed, 10 Jul 2024 21:05:04 -0500
From: David Vernet <void@...ifault.com>
To: Tejun Heo <tj@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-team@...a.com,
	schatzberg.dan@...il.com, mingo@...hat.com, peterz@...radead.org,
	changwoo@...lia.com, righi.andrea@...il.com
Subject: Re: [PATCH 3/6] sched_ext: Unpin and repin rq lock from balance_scx()

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@...nel.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Andrea Righi <righi.andrea@...il.com>
> Cc: David Vernet <void@...ifault.com>

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

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ