scx_lavd: loosen the deadline when overloaded

When the system is highly loaded with compute-intensive tasks, the old
setting chokes latensive-intensive tasks, so loosen the dealine when the
system is overloaded (> 100% utilization).

Signed-off-by: Changwoo Min <changwoo@igalia.com>
This commit is contained in:
Changwoo Min 2024-06-26 15:06:31 +09:00
parent b32734168b
commit ac9c49f5b5
2 changed files with 4 additions and 2 deletions

View File

@ -61,8 +61,9 @@ enum consts {
LAVD_SLICE_MAX_NS = ( 3 * NSEC_PER_MSEC), /* max time slice */
LAVD_SLICE_UNDECIDED = SCX_SLICE_INF,
LAVD_SLICE_GREEDY_FT = 3,
LAVD_LOAD_FACTOR_ADJ = 6,
LAVD_LOAD_FACTOR_ADJ = 6, /* adjustment for better estimation */
LAVD_LOAD_FACTOR_MAX = (10 * 1000),
LAVD_LOAD_FACTOR_FT = 4, /* factor to stretch the time line */
LAVD_LC_FREQ_MAX = 1000000,
LAVD_LC_RUNTIME_MAX = LAVD_TARGETED_LATENCY_NS,

View File

@ -1482,7 +1482,8 @@ static u64 calc_virtual_deadline_delta(struct task_struct *p,
* tick slower to give room to execute the overloaded tasks.
*/
if (load_factor > 1000)
vdeadline_delta_ns = (vdeadline_delta_ns * load_factor) / 1000;
vdeadline_delta_ns = (vdeadline_delta_ns *load_factor *
LAVD_LOAD_FACTOR_FT) / 1000;
taskc->vdeadline_delta_ns = vdeadline_delta_ns;
return vdeadline_delta_ns;