All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>,
	sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>
Cc: Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
	Chia-Ping Tsai <chia7712@gmail.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.1] tools/sched_ext: Add __COMPAT wrapper for scx_bpf_sub_dispatch()
Date: Sun, 22 Mar 2026 10:12:29 -1000	[thread overview]
Message-ID: <b75214fecccfd6256768f87daa7edb29@kernel.org> (raw)
In-Reply-To: <20260322144433.1649092-1-yphbchou0911@gmail.com>

Hello,

Let's not use the __COMPAT prefix. I'd like to move toward making compat
wrappers transparent so that schedulers don't need code changes for
compatibility as much as reasonably possible.

Instead, declare the kfunc with a ___compat suffix and provide a static
inline wrapper with the original name, like scx_bpf_dsq_insert() does:

  bool scx_bpf_sub_dispatch___compat(u64 cgroup_id) __ksym __weak;

  static inline bool scx_bpf_sub_dispatch(u64 cgroup_id)
  {
  	if (bpf_ksym_exists(scx_bpf_sub_dispatch___compat))
  		return scx_bpf_sub_dispatch___compat(cgroup_id);
  	return false;
  }

See tools/sched_ext/include/scx/compat.bpf.h around line 326-342 for the
full pattern.

This way schedulers just call scx_bpf_sub_dispatch() directly and the
compat layer handles everything. The no-op fallback (returning false) is
fine here since without sub-sched support the dispatch path can't do
anything useful anyway.

Thanks.

--
tejun

  reply	other threads:[~2026-03-22 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-22 14:44 [PATCH sched_ext/for-7.1] tools/sched_ext: Add __COMPAT wrapper for scx_bpf_sub_dispatch() Cheng-Yang Chou
2026-03-22 20:12 ` Tejun Heo [this message]
2026-03-23 12:53   ` Cheng-Yang Chou
2026-03-23  7:51 ` Andrea Righi
2026-03-23 12:46   ` Cheng-Yang Chou

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=b75214fecccfd6256768f87daa7edb29@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=chia7712@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.com \
    --cc=yphbchou0911@gmail.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.