walt_update_task_ravg在scheduler_tick中进行更新,即会周期性的更新
walt_update_task_ravg
/* Reflect task activity on its demand and cpu's busy time statistics */
void walt_update_task_ravg(struct task_struct *p, struct rq *rq,
int event, u64 wallclock, u64 irqtime)
{
u64 old_window_start;
if (walt_disabled || !rq->window_start)
return;
lockdep_assert_held(&rq->lock);
old_window_start = update_window_start(rq, wallclock);
if (!p->ravg.mark_start)
goto done;
update_task_demand(p, rq, event, wallclock);
update_cpu_busy_time(p, rq, event, wallclock, irqtime);
done:
if (rq->window_start > old_window_start) {
unsigned long cap_orig = capacity_orig_of(cpu_of(rq));
unsigned int busy_limit =
(walt_ravg_window * walt_busy_threshold) / 100;
// walt_ravg_window 12ms
// walt_busy_threshold 75 繁忙的阈值
busy_limit = (busy_limit * cap_orig) >> SCHED_CAPACITY_SHIFT;
if (rq->prev_runnable_sum >= busy_limit) {
if (

最低0.47元/天 解锁文章
721

被折叠的 条评论
为什么被折叠?



