lkml.org 
[lkml]   [2022]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] sched/core: add forced idle accounting for cgroups
On Fri, May 20, 2022 at 04:51:38PM -0700, Josh Don wrote:

> diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c
> index 38a2cec21014..ddef2b8ddf68 100644
> --- a/kernel/sched/core_sched.c
> +++ b/kernel/sched/core_sched.c
> @@ -277,7 +277,11 @@ void __sched_core_account_forceidle(struct rq *rq)
> if (p == rq_i->idle)
> continue;
>
> - __schedstat_add(p->stats.core_forceidle_sum, delta);
> + /*
> + * Note: this will account forceidle to the current cpu, even
> + * if it comes from our SMT sibling.
> + */
> + account_forceidle_time(p, delta);
> }

AFAICT this is the only caller of that function.

> }
>
> diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
> index 78a233d43757..598d1026d629 100644
> --- a/kernel/sched/cputime.c
> +++ b/kernel/sched/cputime.c
> @@ -226,6 +226,17 @@ void account_idle_time(u64 cputime)
> cpustat[CPUTIME_IDLE] += cputime;
> }
>
> +
> +#ifdef CONFIG_SCHED_CORE
> +/* Account for forceidle time due to core scheduling. */
> +void account_forceidle_time(struct task_struct *p, u64 delta)
> +{
> + schedstat_add(p->stats.core_forceidle_sum, delta);

But then you loose the __, why?

> +
> + task_group_account_field(p, CPUTIME_FORCEIDLE, delta);
> +}
> +#endif

\
 
 \ /
  Last update: 2022-05-21 12:01    [W:0.058 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site