[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5741fb29-a343-1f20-8957-bcd3647f2111@virtuozzo.com>
Date: Thu, 25 Jan 2018 22:44:16 +0300
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Shakeel Butt <shakeelb@...gle.com>,
Michal Hocko <mhocko@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Vladimir Davydov <vdavydov.dev@...il.com>
Subject: Re: [PATCH v5 1/2] mm/memcontrol.c: try harder to decrease
[memory,memsw].limit_in_bytes
On 01/19/2018 04:25 PM, Andrey Ryabinin wrote:
> mem_cgroup_resize_[memsw]_limit() tries to free only 32 (SWAP_CLUSTER_MAX)
> pages on each iteration. This makes it practically impossible to decrease
> limit of memory cgroup. Tasks could easily allocate back 32 pages, so we
> can't reduce memory usage, and once retry_count reaches zero we return
> -EBUSY.
>
> Easy to reproduce the problem by running the following commands:
>
> mkdir /sys/fs/cgroup/memory/test
> echo $$ >> /sys/fs/cgroup/memory/test/tasks
> cat big_file > /dev/null &
> sleep 1 && echo $((100*1024*1024)) > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
> -bash: echo: write error: Device or resource busy
>
> Instead of relying on retry_count, keep retrying the reclaim until the
> desired limit is reached or fail if the reclaim doesn't make any progress
> or a signal is pending.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
> Cc: Shakeel Butt <shakeelb@...gle.com>
> Cc: Michal Hocko <mhocko@...nel.org>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Vladimir Davydov <vdavydov.dev@...il.com>
Andrew, are you ok to pick up the patch?
Powered by blists - more mailing lists