Commit Graph

1386 Commits

Author SHA1 Message Date
Daniel Hodges
f2a6661a85
Merge pull request #524 from hodgesds/layered-core-fixes
scx_layered: Fix core selection
2024-08-21 08:13:33 -04:00
Tejun Heo
9c62019c81
Merge pull request #527 from sched-ext/htejun/scx_utils
scx_utils::cpumask,topology: Misc updates
2024-08-20 22:25:25 -10:00
Andrea Righi
e0fb99835d
Merge pull request #525 from sched-ext/bpfland-disable-interactive
scx_bpfland: allow to completely disable interactive classification
2024-08-21 10:02:43 +02:00
Tejun Heo
1da249f063 scx_utils::topology: Always use NR_CPU_IDS and NR_CPUS_POSSIBLE
Always use the LazyLock versions and drop the counterparts from Topology.
2024-08-20 21:57:56 -10:00
Tejun Heo
1ae4655b3c scx_utils::cpumask: Default to displaying in hex
There isn't much to gain by displaying cpumasks in binary. Drop separate
Display implementation just default to 'x' formatting.
2024-08-20 21:50:23 -10:00
Tejun Heo
092f5422d6
Merge pull request #518 from sched-ext/htejun/misc
scx_layered: Add `--run-example` and enable CI testing
2024-08-20 21:42:45 -10:00
Tejun Heo
3ca2f0b6f9 scx_utils/cpumask: Use nr_cpu_ids instead of num_possible_cpus
- Add static NR_CPU_IDS and NR_CPUS_POSSIBLE to topology.

- Fix comment for Topology::nr_cpu_ids(). Was missing a negation.

- cpumaks should be sized by nr_cpus_ids, not num_possible_cpus and the
  number can't change while the system is running. Drop cpumask.nr_cpus and
  use *NR_CPU_IDS everywhere.
2024-08-20 21:25:40 -10:00
Tejun Heo
0cc59a5243 scx_utils: cargo fmt 2024-08-20 21:25:40 -10:00
Tejun Heo
91213de713 Merge branch 'main' into htejun/rusty 2024-08-20 21:13:12 -10:00
Tejun Heo
2d449f3288
Merge pull request #523 from Kawanaao/openrc-logrotate
openrc: Add logrotate support for openrc systems
2024-08-20 21:10:51 -10:00
Tejun Heo
f7c193e528 scx_utils, scx_rusty: Minor updates to version handling
- Update scx_utils/build.rs so that 12 char SHA1 is generated instead of
  full one.

- Add --version to scx_rusty. Use custom one as we don't want to use the
  default cargo version one.
2024-08-20 21:03:05 -10:00
Tejun Heo
8f786be08f scx_rusty: cargo fmt 2024-08-20 21:03:05 -10:00
Tejun Heo
4440567949 scx_rusty: Update Cargo.lock 2024-08-20 21:03:05 -10:00
Andrea Righi
c85315d527 scx_bpfland: allow to completely disable interactive classification
Tasks enqueued with SCX_ENQ_WAKEUP are immediately classified as
interactive. However, if interactive tasks classification is disabled
(via `-c 0`), we should avoid promoting them as interactive.

This is particularly important because, with the nvcsw logic disabled,
tasks can remain classified as interactive indefinitely and they will
never be demoted to regular tasks.

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-08-21 08:45:13 +02:00
Andrea Righi
014dc7b3c3
Merge pull request #522 from sched-ext/bpfland-cpumask
scx_bpfland: use scx_utils::Cpumask
2024-08-21 08:37:43 +02:00
Andrea Righi
a9f5aaa536 scx_bpfland: replace custom CpuMask with scx_utils::Cpumask
Rely on scx_utils::Cpumask instead of re-implementing a custom struct to
parse and manage CPU masks.

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-08-21 07:21:52 +02:00
Andrea Righi
235f19fdf1 cpumask: implement hex string formatter
Allow to format a Cpumask as an hex string, implementing the proper
formatter LowerHex / UpperHex traits.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-08-21 07:21:22 +02:00
Daniel Hodges
4d1c932619 scx_layered: Fix core selection
Fix a bug introduced in #510 where it assumed core ids are incremental.
This refactors the core ordering for layers to be far more simple and
provide some space for layer core isolation in low utilization.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-20 19:26:53 -07:00
Kawanaao
f35717e970
Create scx.logrotate 2024-08-20 18:02:15 +03:00
Kawanaao
3485adb47f
Add support for openrc logrotate 2024-08-20 17:47:16 +03:00
Andrea Righi
33b6ada98e
Merge pull request #509 from sched-ext/bpfland-topology
scx_bpfland: topology awareness
2024-08-20 14:37:23 +02:00
Daniel Hodges
9f2d548b8f
Merge pull request #520 from hodgesds/merge-fixes
ci: Fix cache directory
2024-08-20 07:33:22 -04:00
Andrea Righi
467d4b5ea4 scx_bpfland: get topology information from scx_utils::Topology
Rely on scx_utils::Topology to get CPU and cache information, instead of
re-implementing custom methods.

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-08-20 10:16:02 +02:00
Andrea Righi
0b2dc6b9fc scx_utils: Add L2 / L3 cache id to CPU
Add the L2 / L3 cache id to the Cpu struct, to quickly determine the
cache nodes associated to each CPU.

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-08-20 10:16:02 +02:00
Tejun Heo
c0fcc9bdeb meson-scripts/test_sched: Enable scx_layered testing
scx_layered now can be run with a single command when `--run-example` is
specified. Update test_sched script to support per-sched arguments and
enable it for scx_layered.
2024-08-19 20:50:10 -10:00
Tejun Heo
c0418250f4 scx_layered: Add --run-example option
So that scx_layered can be run in CI environment in a single command.
2024-08-19 20:50:10 -10:00
Daniel Hodges
e121dd3dd5 ci: Fix cache directory
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 20:07:50 -07:00
Daniel Hodges
03944694a9
Merge pull request #519 from hodgesds/veristat-merge-fix
ci: fix merge veristat cache generation
2024-08-19 21:58:00 -04:00
Daniel Hodges
40bb003555 ci: fix merge veristat cache generation
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 18:30:32 -07:00
Daniel Hodges
d7cc4f30f0
Merge pull request #515 from hodgesds/veristat-fix
ci: fix veristat for PRs
2024-08-19 20:05:13 -04:00
Changwoo Min
41bc6f0967
Merge pull request #511 from multics69/lavd-perf-profile
scx_lavd: add power profile options: --performance, --balanced, --powersave
2024-08-20 09:02:37 +09:00
Changwoo Min
1d61dd4c1d
Merge pull request #508 from multics69/lavd-numa-fix
scx_lavd: fix a potential watchdog timeout error at multi-NUMA/CCX platforms
2024-08-20 09:02:23 +09:00
Changwoo Min
2c4c2a0ccf
Merge pull request #507 from multics69/lavd-pretty-rust
scx_lavd: revise FlatTopology prettier
2024-08-20 09:01:26 +09:00
Daniel Hodges
05a2721f8e
Merge pull request #510 from hodgesds/layered-core-topo-selection
scx_layered: Use topology for core selection
2024-08-19 20:01:16 -04:00
Tejun Heo
695a33cdcc
Merge pull request #517 from sched-ext/htejun/fix
scx_layered: Fix verification failure
2024-08-19 13:44:38 -10:00
Daniel Hodges
1ff5e4fbed ci: fix veristat for PRs
Make sure veristat is available for CI for PRs.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 16:42:31 -07:00
Tejun Heo
d01b49bd0e scx_layered: Fix verification failure
4fccc06905 ("scx_layered: Fix uninitialized variable") causes the
following verification failure. Fix it by moving assignments below range
checking.

  Validating match_layer() func#1...
  283: R1=scalar() R2=scalar() R3=mem_or_null(id=49,sz=1) R10=fp0
  ; int match_layer(u32 layer_id, pid_t pid, const char *cgrp_path) @ main.bpf.c:1029
  283: (7b) *(u64 *)(r10 -24) = r3      ; R3=mem_or_null(id=49,sz=1) R10=fp0 fp-24_w=mem_or_null(id=49,sz=1)
  284: (bc) w7 = w1                     ; R1=scalar() R7_w=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
  ; struct layer *layer = &layers[layer_id]; @ main.bpf.c:1033
  285: (bc) w1 = w7                     ; R1_w=scalar(id=50,smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) R7_w=scalar(id=50,smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
  286: (27) r1 *= 1061192               ; R1_w=scalar(smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8))
  287: (18) r8 = 0xffffc90002a26000     ; R8_w=map_value(map=bpf_bpf.bss,ks=4,vs=16979080)
  289: (0f) r8 += r1                    ; R1_w=scalar(smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8)) R8_w=map_value(map=bpf_bpf.bss,ks=4,vs=16979080,smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8))
  ; u32 nr_match_ors = layer->nr_match_ors; @ main.bpf.c:1034
  290: (bf) r1 = r8                     ; R1_w=map_value(map=bpf_bpf.bss,ks=4,vs=16979080,smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8)) R8_w=map_value(map=bpf_bpf.bss,ks=4,vs=16979080,smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8))
  291: (07) r1 += 1060992               ; R1_w=map_value(map=bpf_bpf.bss,ks=4,vs=16979080,off=0x103080,smin=0,smax=umax=0x103147ffefceb8,smax32=0x7ffffff8,umax32=0xfffffff8,var_off=(0x0; 0x1ffffffffffff8))
  292: (61) r1 = *(u32 *)(r1 +0)
  R1 unbounded memory access, make sure to bounds check any such access
  processed 1099 insns (limit 1000000) max_states_per_insn 2 total_states 72 peak_states 72 mark_read 9
  -- END PROG LOAD LOG --
2024-08-19 13:18:20 -10:00
Tejun Heo
c0b4deb9ec
Merge pull request #516 from sched-ext/htejun/scx_stats
scx_stats/scripts/scxstats_to_openmetrics: Retry connection
2024-08-19 13:02:22 -10:00
Tejun Heo
4e859d067e scx_stats/scripts/scxstats_to_openmetrics: Retry connection
It now retries until told to exit. This is a bit easier to use and matches
`scx_layered --monitor`.
2024-08-19 12:52:57 -10:00
Daniel Hodges
b3793e0069 scx_layered: Use topology for core selection
Currently the core selection logic in scx_layered uses the first
available core in the bitmask. This is suboptimal when the scheduler is
configured with specific NUMA/LLC restrictions. The ideal core selection
logic should try to find the least used cores within the preferred
scheduling domain and allocate new cpus from shared cores within that
domain.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 15:51:35 -07:00
Tejun Heo
3498a2b899
Merge pull request #514 from sched-ext/htejun/scx_stats
scx_stats, scx_layered: Implement independent stats client sessions
2024-08-19 11:24:53 -10:00
Tejun Heo
4198807841
Merge pull request #506 from vax-r/uninit_var
scx_layered: Fix uninitialized variable
2024-08-19 11:13:23 -10:00
Tejun Heo
f6bc52d31e scx_layered: Make --monitor behavior more useful
- If --monitor is specified with layer specs, the scheduler also starts
  stats monitoring on a thread.

- Standalone monitoring mode no longer exits when the scheduler isn't there.
2024-08-19 10:55:02 -10:00
Tejun Heo
cb9a2f5c32
Merge pull request #512 from hodgesds/doc-improvements
docs: Update developer guide
2024-08-19 09:33:38 -10:00
Tejun Heo
ab6cf29a2d
Merge pull request #513 from hodgesds/ci-fixes
ci: Fix veristat pull request workflow
2024-08-19 09:33:09 -10:00
Tejun Heo
d03e48eb75 scx_layered: Implement per-stats-client nr_layer_cpus_ranges tracking
With this, every client sees the correct nr_layer_cpus_ranges without
interfering with each other.
2024-08-19 09:12:51 -10:00
Daniel Hodges
7c27f8067d ci: Fix veristat pull request workflow
See the [failure](https://github.com/sched-ext/scx/actions/runs/10389671253), which needs to have an action defined.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 12:08:59 -07:00
Tejun Heo
448aacfd60 scx_layered: Initialize Stats.prev_layer_cycles properly on new()
So that new stats session doesn't start with an inflated utilization number.
2024-08-19 08:40:40 -10:00
Tejun Heo
6cba8d786a scx_stats: server: open_ops must be kept throughout a client session
open_ops tracks which ops have been opened by the client session; however,
it was being created on each handle_request() making every request to open
each time. Fix it by moving it to the caller.
2024-08-19 08:38:13 -10:00
Daniel Hodges
0048f8dd38 docs: Update developer guide
Add some info on `perf` to the developer guide and link from the main
readme.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-19 11:34:15 -07:00