From: Tejun Heo <tj@kernel.org>
To: David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>
Cc: sched-ext@lists.linux.dev, Emil Tsalapatis <emil@etsalapatis.com>,
linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH 4/6] tools/sched_ext/include: Add __COMPAT_HAS_scx_bpf_select_cpu_and macro
Date: Sat, 7 Mar 2026 16:45:17 -1000 [thread overview]
Message-ID: <20260308024519.1980564-5-tj@kernel.org> (raw)
In-Reply-To: <20260308024519.1980564-1-tj@kernel.org>
scx_bpf_select_cpu_and() is now an inline wrapper so
bpf_ksym_exists(scx_bpf_select_cpu_and) no longer works. Add
__COMPAT_HAS_scx_bpf_select_cpu_and macro that checks for either the
struct args type (new) or the compat ksym (old) to test availability.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
tools/sched_ext/include/scx/compat.bpf.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h
index 2d3985be7e2c..704728864d83 100644
--- a/tools/sched_ext/include/scx/compat.bpf.h
+++ b/tools/sched_ext/include/scx/compat.bpf.h
@@ -266,6 +266,14 @@ scx_bpf_select_cpu_and(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
}
}
+/*
+ * scx_bpf_select_cpu_and() is now an inline wrapper. Use this instead of
+ * bpf_ksym_exists(scx_bpf_select_cpu_and) to test availability.
+ */
+#define __COMPAT_HAS_scx_bpf_select_cpu_and \
+ (bpf_core_type_exists(struct scx_bpf_select_cpu_and_args) || \
+ bpf_ksym_exists(scx_bpf_select_cpu_and___compat))
+
/**
* scx_bpf_dsq_insert_vtime - Insert a task into the vtime priority queue of a DSQ
* @p: task_struct to insert
--
2.53.0
next prev parent reply other threads:[~2026-03-08 2:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 2:45 [PATCHSET sched_ext/for-7.1] tools/sched_ext/include: Sync include files with scx repo Tejun Heo
2026-03-08 2:45 ` [PATCH 1/6] tools/sched_ext/include: Remove dead sdt_task_defs.h guard from common.h Tejun Heo
2026-03-08 2:45 ` [PATCH 2/6] tools/sched_ext/include: Sync bpf_arena_common.bpf.h with scx repo Tejun Heo
2026-03-08 2:45 ` [PATCH 3/6] tools/sched_ext/include: Add missing helpers to common.bpf.h Tejun Heo
2026-03-08 2:45 ` Tejun Heo [this message]
2026-03-08 2:45 ` [PATCH 5/6] tools/sched_ext/include: Add libbpf version guard for assoc_struct_ops Tejun Heo
2026-03-08 2:45 ` [PATCH 6/6] tools/sched_ext/include: Regenerate enum_defs.autogen.h Tejun Heo
2026-03-08 8:20 ` [PATCHSET sched_ext/for-7.1] tools/sched_ext/include: Sync include files with scx repo Andrea Righi
2026-03-08 8:49 ` 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=20260308024519.1980564-5-tj@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=emil@etsalapatis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox