All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: void@manifault.com, arighi@nvidia.com, multics69@gmail.com
Cc: linux-kernel@vger.kernel.org, sched-ext@meta.com
Subject: [PATCHSET sched_ext/for-6.16] sched_ext: Reduce usage of static_keys
Date: Tue,  8 Apr 2025 13:06:00 -1000	[thread overview]
Message-ID: <20250408230616.2369765-1-tj@kernel.org> (raw)

sched_ext uses static_keys to optimize branches on ops flags and which ops
are implemented. Some of those branches aren't that hot and while others are
hotter, they are unlikely to cause meaningful overhead difference given
everything else that's going on. static_keys were used more because there
was no reason not to use static_keys. However, the planned multiple
hierarchical scheduler support won't work with global static_keys as these
branches would have to be based on the specific ops instance.

This patchset replaces static_key usages with tests on ops.flags and a
bitmap tracking which operation is implemented. I couldn't see performance
difference in numerous hackbench runs on a Ryzen 3990x machine before and
after the patchset.

This patchset contains the following five patches:

 0001-sched_ext-Indentation-updates.patch
 0002-sched_ext-Remove-scx_ops_enq_-static_keys.patch
 0003-sched_ext-Remove-scx_ops_cpu_preempt-static_key.patch
 0004-sched_ext-Remove-scx_ops_allow_queued_wakeup-static_.patch
 0005-sched_ext-Make-scx_has_op-a-bitmap.patch

and is also available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-remove-static_keys

diffstat follows. Thanks.

 kernel/sched/ext.c |   91 +++++++++++++++++++++++------------------------------
 kernel/sched/ext.h |    8 ----
 2 files changed, 42 insertions(+), 57 deletions(-)

--
tejun


             reply	other threads:[~2025-04-08 23:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 23:06 Tejun Heo [this message]
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
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=20250408230616.2369765-1-tj@kernel.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 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.