lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1803211418170.107059@chino.kir.corp.google.com>
Date:   Wed, 21 Mar 2018 14:22:13 -0700 (PDT)
From:   David Rientjes <rientjes@...gle.com>
To:     Michal Hocko <mhocko@...nel.org>
cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Johannes Weiner <hannes@...xchg.org>,
        "Kirill A. Shutemov" <kirill@...temov.name>,
        Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

On Wed, 21 Mar 2018, Michal Hocko wrote:

> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d1a917b5b7b7..08accbcd1a18 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1493,7 +1493,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg)
>  
>  static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
>  {
> -	if (!current->memcg_may_oom)
> +	if (!current->memcg_may_oom || order > PAGE_ALLOC_COSTLY_ORDER)
>  		return;
>  	/*
>  	 * We are in the middle of the charge context here, so we

What bug reports have you received about order-4 and higher order non thp 
charges that this fixes?

The patch title and the changelog specifically single out thp, which I've 
fixed, since it has sane fallback behavior and everything else uses 
__GFP_NORETRY.  I think this is misusing a page allocator heuristic that 
hasn't been applied to the memcg charge path before to address a thp 
regression but generalizing it for all charges.

PAGE_ALLOC_COSTLY_ORDER is a heuristic used by the page allocator because 
it cannot free high-order contiguous memory.  Memcg just needs to reclaim 
a number of pages.  Two order-3 charges can cause a memcg oom kill but now 
an order-4 charge cannot.  It's an unfair bias against high-order charges 
that are not explicitly using __GFP_NORETRY.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ