Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453253

Re: [PATCH] memcg: put soft limit reclaim out of way if the excess tree is empty

From Vladimir Davydov <vdavydov@virtuozzo.com>
Newsgroups linux.kernel
Subject Re: [PATCH] memcg: put soft limit reclaim out of way if the excess tree is empty
Date 2016-08-01 16:40 +0200
Message-ID <s1met-7pd-23@gated-at.bofh.it> (permalink)
References <s1ikx-4Uz-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 01, 2016 at 12:00:21PM +0200, Michal Hocko wrote:
...
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index c265212bec8c..eb7e39c2d948 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2543,6 +2543,11 @@ static int mem_cgroup_resize_memsw_limit(struct mem_cgroup *memcg,
>  	return ret;
>  }
>  
> +static inline bool soft_limit_tree_empty(struct mem_cgroup_tree_per_node *mctz)
> +{
> +	return rb_last(&mctz->rb_root) == NULL;
> +}
> +

I don't think traversing rb tree as rb_last() does w/o holding the lock
is a good idea. Why is RB_EMPTY_ROOT() insufficient here?

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] memcg: put soft limit reclaim out of way if the excess tree is empty Michal Hocko <mhocko@kernel.org> - 2016-08-01 12:10 +0200
  Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Michal Hocko <mhocko@kernel.org> - 2016-08-01 16:20 +0200
    Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Johannes Weiner <hannes@cmpxchg.org> - 2016-08-01 17:10 +0200
      Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Michal Hocko <mhocko@kernel.org> - 2016-08-01 17:40 +0200
        Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Johannes Weiner <hannes@cmpxchg.org> - 2016-08-01 19:20 +0200
          Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Michal Hocko <mhocko@kernel.org> - 2016-08-01 19:50 +0200
  Re: [PATCH] memcg: put soft limit reclaim out of way if the excess  tree is empty Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-08-01 16:40 +0200

csiph-web