[Devel] [PATCH rh7] mm/memcg: add missing kmem charge.
Vasily Averin
vvs at virtuozzo.com
Wed Aug 30 14:41:55 MSK 2017
On 2017-08-29 18:13, Andrey Ryabinin wrote:
> Since de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.")
> if try_charge() decide to bypass memory limit, mem_cgroup_charge_kmem()
memcg_charge_kmem() should be here
> will charge only ->memory/->memsw but not ->kmem. This may lead to
> deadlocks during cgroup destruction as condition:
> (page_counter_read(&memcg->memory) -
> page_counter_read(&memcg->kmem) > 0)
>
> in mem_cgroup_reparent_charges() won't come true ever.
>
> https://jira.sw.ru/browse/PSBM-70556
> Fixes: de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.")
> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Reviewed-by: Vasily Averin <vvs at virtuozzo.com>
> ---
> mm/memcontrol.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 5ab5e82c924e..49d4586c9d21 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3087,6 +3087,8 @@ int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp,
> page_counter_charge(&memcg->memory, nr_pages);
> if (do_swap_account)
> page_counter_charge(&memcg->memsw, nr_pages);
> + page_counter_charge(&memcg->kmem, nr_pages);
> +
> ret = 0;
> }
>
>
More information about the Devel
mailing list