mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: void@manifault.com, multics69@gmail.com,
	linux-kernel@vger.kernel.org, sched-ext@meta.com
Subject: Re: [PATCH 5/5] sched_ext: Make scx_has_op a bitmap
Date: Wed, 9 Apr 2025 08:51:24 -1000	[thread overview]
Message-ID: <Z_bBrENa2luRC7nT@slm.duckdns.org> (raw)
In-Reply-To: <Z_Yoh6Is2BaxwdyC@gpd3>

Hello,

On Wed, Apr 09, 2025 at 09:57:59AM +0200, Andrea Righi wrote:
> On Tue, Apr 08, 2025 at 01:06:05PM -1000, Tejun Heo wrote:
> > scx_has_op is used to encode which ops are implemented by the BPF scheduler
> > into an array of static_keys. While this saves a bit of branching overhead,
> > that is unlikely to be noticeable compared to the overall cost. As the
> > global static_keys can't work with the planned hierarchical multiple
> > scheduler support, replace the static_key array with a bitmap.
> > 
> > In repeated hackbench runs before and after static_keys removal on an AMD
> > Ryzen 3900X, I couldn't tell any measurable performance difference.
> 
> At this point I'm wondering if we should just do something like:
> 
>  #define SCX_HAS_OP(op) (scx_ops.op != NULL)
> 
> Do you think the bitmap can provide some measurable benefits? For the most
> frequently used hot paths (enqueue, dispatch, select_cpu, running,
> stopping) we likely have to fetch scx_ops.op anyway, so cache-wise the
> difference should be minimal.

Performance-wise, unlikely. However, we need to be able to enable ops in
stages during init - CPU hotplug ops need to be enabled before other ops. We
can do that by setting the op pointers in stages but the code was already
structured in a way which is easy to convert to bitmap, so that was the path
of least resistance. We surely can change it.

Thanks.

-- 
tejun

  reply	other threads:[~2025-04-09 18:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 23:06 [PATCHSET sched_ext/for-6.16] sched_ext: Reduce usage of static_keys Tejun Heo
2025-04-08 23:06 ` [PATCH 1/5] sched_ext: Indentation updates Tejun Heo
2025-04-08 23:06 ` [PATCH 2/5] sched_ext: Remove scx_ops_enq_* static_keys Tejun Heo
2025-04-08 23:06 ` [PATCH 3/5] sched_ext: Remove scx_ops_cpu_preempt static_key Tejun Heo
2025-04-08 23:06 ` [PATCH 4/5] sched_ext: Remove scx_ops_allow_queued_wakeup static_key Tejun Heo
2025-04-08 23:06 ` [PATCH 5/5] sched_ext: Make scx_has_op a bitmap Tejun Heo
2025-04-09  7:57   ` Andrea Righi
2025-04-09 18:51     ` Tejun Heo [this message]
2025-04-09 18:58       ` Andrea Righi
2025-04-09  1:37 ` [PATCHSET sched_ext/for-6.16] sched_ext: Reduce usage of static_keys Changwoo Min
2025-04-09 19:06 ` 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=Z_bBrENa2luRC7nT@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=multics69@gmail.com \
    --cc=sched-ext@meta.com \
    --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®