From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] sched_ext: Introduce rq lock tracking
Date: Tue, 22 Apr 2025 10:26:31 +0200 [thread overview]
Message-ID: <20250422082907.110167-1-arighi@nvidia.com> (raw)
Add rq lock tracking to sched_ext ops callbacks to enable scx_bpf_*()
kfuncs to detect whether a specific rq is currently locked and safely
operate with it.
If no rq is locked, the target rq lock can be acquired. If a different rq
is already locked, the operation can either fail (triggering an ops error),
deferred using IRQ work, or managed accordingly to avoid deadlocks.
This patchset is also available in the following git branch:
git://git.kernel.org/pub/scm/linux/kernel/git/arighi/linux.git scx-rq-lock-tracking
Changes in v3:
- remove unnecessary rq != NULL optimization check in SCX_CALL_OP()
- reorder SCX_CALL_OP*() arguments to group static args together
- link to v2: https://lore.kernel.org/all/20250420193106.42533-1-arighi@nvidia.com/
Changes in v2:
- store currently locked rq in a percpu variable
- link to v1: https://lore.kernel.org/all/20250419123536.154469-1-arighi@nvidia.com
Andrea Righi (2):
sched_ext: Track currently locked rq
sched_ext: Fix missing rq lock in scx_bpf_cpuperf_set()
kernel/sched/ext.c | 179 +++++++++++++++++++++++++++++++-----------------
kernel/sched/ext_idle.c | 2 +-
2 files changed, 118 insertions(+), 63 deletions(-)
next reply other threads:[~2025-04-22 8:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 8:26 Andrea Righi [this message]
2025-04-22 8:26 ` [PATCH 1/2] sched_ext: Track currently locked rq Andrea Righi
2025-07-15 9:13 ` Breno Leitao
2025-07-15 17:20 ` Andrea Righi
2025-07-16 10:47 ` Breno Leitao
2025-07-16 12:40 ` Andrea Righi
2025-07-16 12:43 ` Breno Leitao
2025-04-22 8:26 ` [PATCH 2/2] sched_ext: Fix missing rq lock in scx_bpf_cpuperf_set() Andrea Righi
2025-04-22 19:33 ` [PATCH v3 0/2] sched_ext: Introduce rq lock tracking 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=20250422082907.110167-1-arighi@nvidia.com \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--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®