Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-28 Thread Yang Shi
I think Johannes's point makes sense to me. If the shrinker_maps is not initialized yet it means the memcg is too young to have a number of reclaimable slab caches. It sounds fine to just skip it. And, with consolidating shrinker_maps and shrinker_deferred into one struct, we could just check the

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-15 Thread Yang Shi
On Tue, Dec 15, 2020 at 9:16 AM Johannes Weiner wrote: > > On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: > > The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of > > CSS_ONLINE flag > > in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-15 Thread Johannes Weiner
On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: > The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of > CSS_ONLINE flag > in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will > see > memcg->nodeinfo[nid]->shrinker_maps != NULL. This may oc

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-15 Thread Johannes Weiner
On Tue, Dec 15, 2020 at 03:58:06PM +0300, Kirill Tkhai wrote: > 15.12.2020, 15:40, "Johannes Weiner" : > > On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: > >>  The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility > >> of CSS_ONLINE flag > >>  in shrink_slab_memcg()->

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-15 Thread Kirill Tkhai
15.12.2020, 15:40, "Johannes Weiner" : > On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: >>  The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of >> CSS_ONLINE flag >>  in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will >> see >>  memcg->n

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-15 Thread Johannes Weiner
On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: > The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of > CSS_ONLINE flag > in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will > see > memcg->nodeinfo[nid]->shrinker_maps != NULL. This may oc

Re: [v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-14 Thread Dave Chinner
On Mon, Dec 14, 2020 at 02:37:16PM -0800, Yang Shi wrote: > The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of > CSS_ONLINE flag > in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will > see > memcg->nodeinfo[nid]->shrinker_maps != NULL. This may oc

[v2 PATCH 3/9] mm: vmscan: guarantee shrinker_slab_memcg() sees valid shrinker_maps for online memcg

2020-12-14 Thread Yang Shi
The shrink_slab_memcg() races with mem_cgroup_css_online(). A visibility of CSS_ONLINE flag in shrink_slab_memcg()->mem_cgroup_online() does not guarantee that we will see memcg->nodeinfo[nid]->shrinker_maps != NULL. This may occur because of processor reordering on !x86. This seems like the be