From 48debe416e9f9e8b48492d3bc41a904f46151c83 Mon Sep 17 00:00:00 2001 From: Changwoo Min Date: Wed, 10 Jul 2024 15:12:09 +0900 Subject: [PATCH] scx_lavd: tuning the deadline equation under high load Signed-off-by: Changwoo Min --- scheds/rust/scx_lavd/src/bpf/intf.h | 4 ++-- scheds/rust/scx_lavd/src/bpf/main.bpf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scheds/rust/scx_lavd/src/bpf/intf.h b/scheds/rust/scx_lavd/src/bpf/intf.h index de259c5..4887bb5 100644 --- a/scheds/rust/scx_lavd/src/bpf/intf.h +++ b/scheds/rust/scx_lavd/src/bpf/intf.h @@ -63,7 +63,7 @@ enum consts { LAVD_SLICE_GREEDY_FT = 3, LAVD_LOAD_FACTOR_ADJ = 6, /* adjustment for better estimation */ LAVD_LOAD_FACTOR_MAX = (20 * 1000), - LAVD_LOAD_FACTOR_FT = 80, /* factor to stretch the time line */ + LAVD_LOAD_FACTOR_FT = 4, /* factor to stretch the time line */ LAVD_LC_FREQ_MAX = 1000000, LAVD_LC_RUNTIME_MAX = LAVD_TARGETED_LATENCY_NS, @@ -75,7 +75,7 @@ enum consts { LAVD_SLICE_BOOST_MAX_STEP = 8, /* 8 slice exhausitions in a row */ LAVD_GREEDY_RATIO_MAX = USHRT_MAX, LAVD_LAT_PRIO_IDLE = USHRT_MAX, - LAVD_LAT_WEIGHT_SHIFT = 4, + LAVD_LAT_WEIGHT_SHIFT = 5, LAVD_ELIGIBLE_TIME_LAT_FT = 16, LAVD_ELIGIBLE_TIME_MAX = (100 * NSEC_PER_USEC), diff --git a/scheds/rust/scx_lavd/src/bpf/main.bpf.c b/scheds/rust/scx_lavd/src/bpf/main.bpf.c index ce6deb0..34eb825 100644 --- a/scheds/rust/scx_lavd/src/bpf/main.bpf.c +++ b/scheds/rust/scx_lavd/src/bpf/main.bpf.c @@ -1410,7 +1410,7 @@ static u64 calc_virtual_deadline_delta(struct task_struct *p, * is lower (i.e., higher value) and the load is higher. */ vdeadline_delta_ns = (vdeadline_delta_ns * load_factor * - taskc->lat_prio * taskc->lat_prio) / + taskc->lat_prio) / (LAVD_LOAD_FACTOR_FT * 1000); }