lkml.org 
[lkml]   [2019]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 00/16] Core scheduling v3
On Tue, Aug 06, 2019 at 02:19:57PM -0700, Tim Chen wrote:
> +void account_core_idletime(struct task_struct *p, u64 exec)
> +{
> + const struct cpumask *smt_mask;
> + struct rq *rq;
> + bool force_idle, refill;
> + int i, cpu;
> +
> + rq = task_rq(p);
> + if (!sched_core_enabled(rq) || !p->core_cookie)
> + return;

I don't see why return here for untagged task. Untagged task can also
preempt tagged task and force a CPU thread enter idle state.
Untagged is just another tag to me, unless we want to allow untagged
task to coschedule with a tagged task.

> + cpu = task_cpu(p);
> + force_idle = false;
> + refill = true;
> + smt_mask = cpu_smt_mask(cpu);
> +
> + for_each_cpu(i, smt_mask) {
> + if (cpu == i)
> + continue;
> +
> + if (cpu_rq(i)->core_forceidle)
> + force_idle = true;
> +
> + /* Only refill if everyone has run out of allowance */
> + if (cpu_rq(i)->core_idle_allowance > 0)
> + refill = false;
> + }
> +
> + if (force_idle)
> + rq->core_idle_allowance -= (s64) exec;
> +
> + if (rq->core_idle_allowance < 0 && refill) {
> + for_each_cpu(i, smt_mask) {
> + cpu_rq(i)->core_idle_allowance += (s64) SCHED_IDLE_ALLOWANCE;
> + }
> + }
> +}

\
 
 \ /
  Last update: 2019-08-08 08:48    [W:0.245 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site