[Devel] [PATCH rh7 2/2] mm/memcg: bypass kmem limits
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Mar 1 11:37:06 MSK 2018
We are not happy with changing mainstream logic of kmem.limit (switching it to softlimit).
As we have fixed kmem.limit logic with previous patch, let's test it now, may be its enough and soft limit is not needed anymore.
--
Best regards,
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
On 02/28/2018 01:36 PM, Andrey Ryabinin wrote:
> Relax kmem limit and bypass allocation anyway even if reclaim failed.
>
> https://jira.sw.ru/browse/PSBM-81818
> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
> ---
> mm/memcontrol.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d68650ad7a53..32c6b254ce7d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2863,6 +2863,13 @@ charge:
>
> if (gfp_mask & __GFP_NORETRY)
> goto nomem;
> +
> + if ((flags & MEM_CGROUP_RECLAIM_KMEM) && nr_retries--)
> + goto retry;
> +
> + if (flags & MEM_CGROUP_RECLAIM_KMEM)
> + goto bypass;
> +
> /*
> * Even though the limit is exceeded at this point, reclaim
> * may have been able to free some pages. Retry the charge
> @@ -2895,7 +2902,7 @@ charge:
> nomem:
> mem_cgroup_inc_failcnt(mem_over_limit, gfp_mask, nr_pages);
>
> - if (!(gfp_mask & __GFP_NOFAIL))
> + if (!(gfp_mask & __GFP_NOFAIL) && !(flags & MEM_CGROUP_RECLAIM_KMEM))
> return -ENOMEM;
> bypass:
> return -EINTR;
>
More information about the Devel
mailing list