scx_lavd: add LAVD_VDL_LOOSENESS_FT in calculating virtual deadline

LAVD_VDL_LOOSENESS_FT represents how loose the deadline is. The smaller
value means the deadline is tighter. While it is unlikely to be tuned,
let's keep it as a tunable for now.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
This commit is contained in:
Changwoo Min 2024-07-20 12:00:50 +09:00
parent e94070d5ca
commit c653622ed9
2 changed files with 7 additions and 10 deletions

View File

@ -60,6 +60,7 @@ enum consts {
LAVD_SLICE_MIN_NS = (30 * NSEC_PER_USEC), /* min time slice */
LAVD_SLICE_MAX_NS = ( 3 * NSEC_PER_MSEC), /* max time slice */
LAVD_SLICE_UNDECIDED = SCX_SLICE_INF,
LAVD_VDL_LOOSENESS_FT = 100,
LAVD_LC_FREQ_MAX = 1000000,
LAVD_LC_RUNTIME_MAX = LAVD_TARGETED_LATENCY_NS,

View File

@ -1092,21 +1092,17 @@ static void boost_lat(struct task_struct *p, struct task_ctx *taskc,
taskc->lat_cri = log2_u64(lat_cri_raw + 1) + is_wakeup;
}
static u64 calc_virtual_deadline_delta(struct task_struct *p,
struct task_ctx *taskc,
struct cpu_ctx *cpuc,
u64 enq_flags)
static void calc_virtual_deadline_delta(struct task_struct *p,
struct task_ctx *taskc,
struct cpu_ctx *cpuc,
u64 enq_flags)
{
u64 vdeadline_delta_ns;
bool is_wakeup;
is_wakeup = is_wakeup_ef(enq_flags);
boost_lat(p, taskc, cpuc, is_wakeup);
vdeadline_delta_ns = (taskc->run_time_ns * 1000) / taskc->lat_cri;
taskc->vdeadline_delta_ns = vdeadline_delta_ns;
return vdeadline_delta_ns;
taskc->vdeadline_delta_ns = (taskc->run_time_ns *
LAVD_VDL_LOOSENESS_FT) / taskc->lat_cri;
}
static u64 calc_task_load_actual(struct task_ctx *taskc)