Commit Graph

2182 Commits

Author SHA1 Message Date
Andrea Righi
b3c5a23693 scx_rustland_core: use handle_mm_fault kprobe
The symbol __handle_mm_fault isn't available anymore in 6.12, let's rely
on handle_mm_fault that is available both on 6.12 and older kernels.

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-10-11 15:39:34 +02:00
Changwoo Min
648c95be9e scx_lavd: fix incorrect task comparison for preemption
Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-10-11 21:53:24 +09:00
likewhatevs
b88f567e25
Merge pull request #782 from likewhatevs/lsp-nice-util
layered -- make lsp work nice on util include file
2024-10-11 12:30:19 +00:00
Pat Somaru
2b309dbbb4
make lsp work nice on util include 2024-10-11 08:06:29 -04:00
Pat Somaru
7627e1cc42
scx_layered: fix lsp etc on util.bpf.c 2024-10-11 08:02:23 -04:00
Changwoo Min
5b4b255cbb scx_lavd: do not preempt while holding a lock
When a task holds a lock, it should not yield its time slice or it
should not be preempted out. In this way, we can mitigate harmful
preemption of lock holders and reduce the total preemption counts.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-10-11 18:49:09 +09:00
Changwoo Min
bd17589a6e scx_lavd: boost latency criticality when a task holds a lock
When a lock holder exhausts its time slide, it will be re-enqueued
to a DSQ waiting for shceduling while holding a lock. In this case,
prioritize its latency criticality proportionally, so a lock holder
would be not stuck in a DSQ for a long time, improving system-wide
progress.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-10-11 18:48:56 +09:00
Changwoo Min
77b8e65571 scx_lavd: tracing all blocking locks and futexes
Trace the acquisition and release of blocking locks for kernel and
fuxtexes for user-space. This is necessary to boost a lock holder
task in terms of latency and time slice. We do not boost shared
lock holders (e.g., read lock in rw_semaphore) since the kernel
already prioritizes the readers over writers.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-10-11 17:03:48 +09:00
Ryan Wilson
b6f09edc00
Merge pull request #777 from ryantimwilson/reverse-weight-dsq-layered
[layered] Implement reverse weight DSQ algorithm
2024-10-10 20:18:14 +00:00
Ryan Wilson
8c8250b1e2 [layered] Implement reverse weight DSQ algorithm 2024-10-10 12:53:25 -07:00
Daniel Hodges
9f60053312
Merge pull request #775 from hodgesds/layered-idle-cleanup
scx_layered: Cleanup topology preempt path
2024-10-10 18:34:08 +00:00
Daniel Hodges
9940e48cdd
Merge pull request #776 from hodgesds/layered-default-iter-algo
scx_layered: Change default DSQ iter algo
2024-10-10 18:15:07 +00:00
Daniel Hodges
fb4dcf91eb scx_layered: Change default DSQ iter algo
Change the default DSQ iter algo from round robin to linear.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-10 11:10:27 -07:00
Daniel Hodges
b22e83d4d5 scx_layered: Cleanup topology preempt path
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-10 09:56:42 -07:00
Andrea Righi
59cfd4060c
Merge pull request #772 from sched-ext/bpfland-fix-l3-cpumask
scx_bpfland: fix cpumask initialization error
2024-10-10 08:38:34 +00:00
Andrea Righi
d62989e462 scx_bpfland: fix cpumask initialization error
In the WAKE_SYNC path lf L3 cache awareness is disabled (--disable-l3)
we may hit the following error:

  Error: EXIT: scx_bpf_error (CPU L3 cpumask not initialized)

Fix this by setting the L3 cpumask to the whole primary domain if L3
cache awareness is disabled.

Tested-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-10-10 09:30:54 +02:00
Daniel Hodges
772d89f731
Merge pull request #771 from hodgesds/layered-preempt-no-topo-refactor
scx_layered: Refactor topo preemption
2024-10-10 02:10:22 +00:00
likewhatevs
9c80ebf88a
Merge pull request #770 from likewhatevs/ci-update-tests
scx_layered: setup matrix job to run key paths of layered through verifier/stress
2024-10-10 02:05:20 +00:00
Daniel Hodges
fe00e2c7be
scx_layered: Refactor topo preemption
Refactor topology preemption logic so the non topology aware code is
contianed to a separate function. This should make maintaining the non
topology aware code path far easier.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 21:24:07 -04:00
Pat Somaru
5e4a7ac655
setup matrix job to run key paths of layered through verifier/stress test 2024-10-09 21:09:41 -04:00
Daniel Hodges
e7b1feed5a
Merge pull request #769 from hodgesds/layered-debug-cleanup
scx_layered: Cleanup debug messages
2024-10-09 23:55:11 +00:00
Daniel Hodges
451c68b44e
scx_layered: Cleanup debug messages
Cleanup debug messages to use a common prefix when the scheduler is
initialized.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 19:06:28 -04:00
Daniel Hodges
4b817dc54b
Merge pull request #768 from hodgesds/layered-verifier-fix
scx_layered: Fix verifier errors
2024-10-09 21:52:02 +00:00
Daniel Hodges
81a5250d49 scx_layered: Fix verifier errors
Fix verifier errors when using different DSQ iteration algorithms and
cleanup some code.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 14:36:12 -07:00
Dan Schatzberg
12cf482487
Merge pull request #767 from dschatzberg/mitosis-build
mitosis: Fix build
2024-10-09 19:32:35 +00:00
Dan Schatzberg
c794c389da mitosis: apply autoformatting
Apply clang-format autoformatting on the c code and cargo fmt on the
rust code.

Signed-off-by: Dan Schatzberg <schatzberg.dan@gmail.com>
2024-10-09 10:56:27 -07:00
483a565d7f
Merge pull request #759 from JakeHillion/pr759
layered: attempt to work steal from own llc before others
2024-10-09 17:42:23 +00:00
Daniel Hodges
678c205572
Merge pull request #766 from hodgesds/layered-load-fixes
scx_layered: Rename load_adj statistic
2024-10-09 17:12:24 +00:00
Jake Hillion
d9dc46b5d2 layered: attempt to work steal from own llc before others 2024-10-09 17:39:06 +01:00
Dan Schatzberg
347147b10d mitosis: fix build
Minimal changes to make sure scx_mitosis can build with the latest scx
changes.

Signed-off-by: Dan Schatzberg <schatzberg.dan@gmail.com>
2024-10-09 08:30:15 -07:00
Daniel Hodges
30258cff1b scx_layered: Update docs for layer_preempt_weight_disable
Update docs for layer_preempt_weight_disable and
layer_growth_weight_disable.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 06:37:54 -07:00
Daniel Hodges
edc673460d scx_layered: Rename load_adj statistic
Rename the `load_adj` statistic to `load_frac_adj`, which is a more
accurate representation of what the statistic is calculating. The
statistic is a fractional representation of the load of a layer adjusted
for infeasible weights.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 06:23:37 -07:00
c23efb1ed3
Merge pull request #749 from JakeHillion/pr749
layered: split dispatch into no_topo version
2024-10-09 13:15:12 +00:00
Jake Hillion
19d09c3cc1 layered: split dispatch into no_topo version
Refactor layered_dispatch into two functions: layered_dispatch_no_topo and
layered_dispatch. layered_dispatch will delegate to layered_dispatch_no_topo in
the disable_topology case.

Although this code doesn't run when loaded by BPF due to the global constant
bool blocking it, it makes the functions really hard to parse as a human. As
they diverge more and more it makes sense to split them into separate
manageable functions.

This is basically a mechanical change. I duplicated the existing function,
replaced all `disable_topology` with true in `no_topo` and false in the
existing function, then removed all branches which can't be hit.

Test plan:
- Runs on my dev box (6.9.0 fbkernel) with `scx_layered --run-example -n`.
- As above with `-t`.
- CI.
2024-10-09 13:33:06 +01:00
Daniel Hodges
ef30517936
Merge pull request #758 from hodgesds/layered-ci-fixes
scx_layered: Update CI to show stats
2024-10-09 12:30:34 +00:00
Daniel Hodges
feab01dd44 scx_layered: Update CI to show stats
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-09 05:18:04 -07:00
Daniel Hodges
2b5829e275
Merge pull request #763 from ryantimwilson/rusty-default-weights-fix
[rusty] Fix load stats when host is under-utilized
2024-10-09 12:14:51 +00:00
likewhatevs
29bb3110ec
Merge pull request #765 from likewhatevs/update-dispatch
scx_layered: enable configuring layer iteration when no topo
2024-10-09 06:22:40 +00:00
Pat Somaru
8e2f195af1
enable configuring layer iteration when no topo
enable configuring layer iteration order in dispatch
when topology is disabled.

replace some member_vptr's in that iteration with regular
accesses
2024-10-09 01:53:19 -04:00
Andrea Righi
e3e381dc8e
Merge pull request #755 from sched-ext/bpfland-prevent-kthread-stall
scx_bpfland: prevent per-CPU DSQ stall with per-CPU kthreads
2024-10-09 05:28:59 +00:00
Ryan Wilson
fbdb6664ec [rusty] Fix load stats when host is under-utilized 2024-10-08 21:08:07 -07:00
likewhatevs
0ed36a17da
Merge pull request #764 from likewhatevs/fix-ci-2
scx_layered: fix ci
2024-10-09 02:14:55 +00:00
Pat Somaru
59f35fcbec
update stress test settings to constants used in test_scheds 2024-10-08 22:08:13 -04:00
Pat Somaru
c90144d761
Revert "Merge pull request #746 from likewhatevs/layered-delay"
This reverts commit 2077b9a799, reversing
changes made to eb73005d07.
2024-10-08 22:01:05 -04:00
likewhatevs
e1232b5efc
Merge pull request #760 from hodgesds/layered-example-fix
scx_layered: Make stress-ng non exclusive in example
2024-10-08 20:48:18 -04:00
Daniel Hodges
e6773d43b1 scx_layered: Make stress-ng non exclusive in example
Test CI hosts are VMs currently and making stress-ng exclusive may
starve the host.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-08 10:49:51 -07:00
Daniel Hodges
66f967c06d
Merge pull request #756 from hodgesds/layered-example-stress
scx_layered: Add stress-ng example layer
2024-10-08 15:31:44 +00:00
likewhatevs
e1f6c792fe
Merge pull request #757 from JakeHillion/pr757
layered: cleanup warnings in bpf compilation
2024-10-08 15:29:12 +00:00
Jake Hillion
85daa2be32 layered: cleanup warnings in bpf compilation
clang is correctly warning that we use various uninitialised variables. clean
these up so real errors are easier to read.

The largest change here is to non-topological layered_dispatch. The
matching_dsq logic seems to be incorrect. It checks whether an uninitialised
variable is 0, if it is sets it, then only uses the variable if the value is 0.
I have changed this to default to -1, then use the value if it is no longer -1.
2024-10-08 16:25:43 +01:00
Daniel Hodges
e0ddff1403 scx_layered: Add verbose output on stress tests
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-08 08:20:59 -07:00