Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Use update_curr_common() in update_curr_scx()

update_curr_scx() is open coding runtime updates. Use update_curr_common()
instead and avoid unnecessary deviations.

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David Vernet <void@manifault.com>

+4 -10
+4 -10
kernel/sched/ext.c
··· 1466 1466 static void update_curr_scx(struct rq *rq) 1467 1467 { 1468 1468 struct task_struct *curr = rq->curr; 1469 - u64 now = rq_clock_task(rq); 1470 - u64 delta_exec; 1469 + s64 delta_exec; 1471 1470 1472 - if (time_before_eq64(now, curr->se.exec_start)) 1471 + delta_exec = update_curr_common(rq); 1472 + if (unlikely(delta_exec <= 0)) 1473 1473 return; 1474 1474 1475 - delta_exec = now - curr->se.exec_start; 1476 - curr->se.exec_start = now; 1477 - curr->se.sum_exec_runtime += delta_exec; 1478 - account_group_exec_runtime(curr, delta_exec); 1479 - cgroup_account_cputime(curr, delta_exec); 1480 - 1481 1475 if (curr->scx.slice != SCX_SLICE_INF) { 1482 - curr->scx.slice -= min(curr->scx.slice, delta_exec); 1476 + curr->scx.slice -= min_t(u64, curr->scx.slice, delta_exec); 1483 1477 if (!curr->scx.slice) 1484 1478 touch_core_sched(rq, curr); 1485 1479 }