lkml.org 
[lkml]   [2018]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/10] mm: Assign memcg-aware shrinkers bitmap to memcg
On Wed, Mar 21, 2018 at 04:21:40PM +0300, Kirill Tkhai wrote:
> +++ b/include/linux/memcontrol.h
> @@ -151,6 +151,11 @@ struct mem_cgroup_thresholds {
> struct mem_cgroup_threshold_ary *spare;
> };
>
> +struct shrinkers_map {
> + struct rcu_head rcu;
> + unsigned long *map[0];
> +};
> +
> enum memcg_kmem_state {
> KMEM_NONE,
> KMEM_ALLOCATED,
> @@ -182,6 +187,9 @@ struct mem_cgroup {
> unsigned long low;
> unsigned long high;
>
> + /* Bitmap of shrinker ids suitable to call for this memcg */
> + struct shrinkers_map __rcu *shrinkers_map;
> +
> /* Range enforcement for interrupt charges */
> struct work_struct high_work;
>

Why use your own bitmap here? Why not use an IDA which can grow and
shrink automatically without you needing to play fun games with RCU?

\
 
 \ /
  Last update: 2018-03-21 15:58    [W:0.317 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site