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


Groups > linux.kernel > #1534438

Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes
Date 2016-12-01 22:10 +0100
Message-ID <sJGM9-2gf-7@gated-at.bofh.it> (permalink)
References <sJzAZ-4ng-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Dec 01, 2016 at 02:21:56PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
> has made the workingset shadow nodes shrinker memcg aware. The
> implementation is not correct though because memcg_kmem_enabled() might
> become true while we are doing a global reclaim when the sc->memcg might
> be NULL which is exactly what Marek has seen:

[...]

> This patch fixes the issue by checking sc->memcg rather than memcg_kmem_enabled()
> which is sufficient because shrink_slab makes sure that only memcg aware shrinkers
> will get non-NULL memcgs and only if memcg_kmem_enabled is true.
> 
> Fixes: 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
> Reported-and-tested-by: Marek Marczykowski-Górecki <marmarek@mimuw.edu.pl>
> Cc: stable@vger.kernel.org # 4.6+
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Thanks Michal

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


Thread

[PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes Michal Hocko <mhocko@kernel.org> - 2016-12-01 14:30 +0100
  Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes Vladimir Davydov <vdavydov@tarantool.org> - 2016-12-01 15:00 +0100
  Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes Johannes Weiner <hannes@cmpxchg.org> - 2016-12-01 22:10 +0100
  Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes Balbir Singh <bsingharora@gmail.com> - 2016-12-01 22:30 +0100

csiph-web