lkml.org 
[lkml]   [2019]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] numa: introduce per-cgroup numa balancing locality, statistic
On Wed, Jul 03, 2019 at 11:28:10AM +0800, 王贇 wrote:
> +#ifdef CONFIG_NUMA_BALANCING
> +
> +enum memcg_numa_locality_interval {
> + PERCENT_0_29,
> + PERCENT_30_39,
> + PERCENT_40_49,
> + PERCENT_50_59,
> + PERCENT_60_69,
> + PERCENT_70_79,
> + PERCENT_80_89,
> + PERCENT_90_100,
> + NR_NL_INTERVAL,
> +};

That's just daft; why not make 8 equal sized buckets.

> +struct memcg_stat_numa {
> + u64 locality[NR_NL_INTERVAL];
> +};

> + if (remote || local) {
> + idx = ((local * 10) / (remote + local)) - 2;

idx = (NR_NL_INTERVAL * local) / (remote + local);

> + }
> +
> + rcu_read_lock();
> + memcg = mem_cgroup_from_task(p);
> + if (idx != -1)
> + this_cpu_inc(memcg->stat_numa->locality[idx]);
> + rcu_read_unlock();
> +}
> +#endif

\
 
 \ /
  Last update: 2019-07-11 15:44    [W:0.202 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site