Skip to content

Move uclamp to each sched_class

Hongyan Xia lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sched/uclamp: Delegate uclamp to each sched_classkernel/sched/core.c kernel/sched/ext.c kernel/sched/fair.c +2 more+18 -281 reply
2/2sched/ext: Add BPF functions for uclamp inc and deckernel/sched/ext.c tools/sched_ext/include/scx/common.bpf.h+14 -02 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchTejun Heo
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Move uclamp to each sched_class

Hi. I only just started looking at sched_ext a couple of days ago so feel free to correct me if sched_ext patches have different rules, different cc's and different mailing lists than normal LKML.

This mini series delegates uclamp operations to each sched_class. The problem with the current handling of uclamp is that it seems to be a global thing but it conditions on sched_class->uclamp_enabled anyway, so it is in fact already kind of sched_class-specific. So, remove sched_class->uclamp_enabled and just let each class decide what to do.

More importantly, sched_ext no longer unconditionally follows the existing uclamp implementation, but instead each custom scheduler decides itself what to do. It can re-use the existing uclamp, ignore uclamp completely, or have its own uclamp implementation.

Some simple testing with trace_printk() shows uclamp_rq_{inc,dec}() are called successfully from a sched_ext scheduler:

	[002] d..21  1016.017441: uclamp_rq_dec: sched_ext uclamp dec
	[002] dN.21  1016.017456: uclamp_rq_inc: sched_ext uclamp inc

Hongyan Xia (2):
sched/uclamp: Delegate uclamp to each sched_class sched/ext: Add BPF functions for uclamp inc and dec

 kernel/sched/core.c                      | 14 ++------------
 kernel/sched/ext.c                       | 16 ++++++++++++----
 kernel/sched/fair.c                      |  6 ++----
 kernel/sched/rt.c                        |  7 +++----
 kernel/sched/sched.h                     | 15 +++++++++++----
 tools/sched_ext/include/scx/common.bpf.h |  2 ++
 6 files changed, 32 insertions(+), 28 deletions(-)
Signature · 1 line
2.34.1