Received: by 10.213.65.68 with SMTP id h4csp3614396imn; Tue, 3 Apr 2018 07:59:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx49JXx2EeZ/KsarYsXllf39bWft5m8MIGnScrPF27fXUwcZjZ4OUoZ+NHX8yS42FhnwfuGCq X-Received: by 10.99.54.65 with SMTP id d62mr9305183pga.225.1522767558627; Tue, 03 Apr 2018 07:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522767558; cv=none; d=google.com; s=arc-20160816; b=SifWqx2v4vD9PRxrrTKC5wIWymncJVZYaqLP0jm5qUfZW9R0beRZ/9o4ZArSLr2rxh +6W2ygPTvSK/DSmWSqizIko/uNAa83gg6oFGNSxRSW3is2gOY6Ws5fWtK3FPx7u5lHJe Os9A8uCK/H/jvokNdbLVFme84WpPpMfFmKXGALOJ/HodCdYL1N4/tjNzIj+lyM4DtzaD liRp6OSGmpRMtsUVCXMt1sSmv0Zs1LgZB0Rd0h7fNVz30U9u+fn4J+Q483fEoN7B091v NzWdYPFPmQB4ilA78XXF7VtofaPKoqil1K6VajUMnIXcbX0oKMNJdVOtUQSKGvsa3ue8 Y+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=BjD2//1TSzT2ZwvS4EctHdL4erMS4mJxuPohC+aoI/s=; b=WM0viCwUAfgriKRo/jfo0JDFxJgaXvt41yPiZA249HBTJa0LD8Y7AXP2s50whLx4mB V/zREM9uba3JeFfUle3s0T4kmVV5jfv2hjmgP5U4xwZcOZLETPUqQ61KAF6GN0U5DdTR /2y91eV45RzL8K+t+foB4T1aBJpx8dsB4/b/4g+SoZnVgOiyijt95g1KZcEWd+O3NtY/ g2MNXV7/knLimwFwDYJP2re1rTP/bhgfvcIxkBDEqzi9YM5l83FEJK6x7pvNHTZncOHk toSkOotjiavs0ZPb93aNz2p/N9Q/6FonVzSsvp7jtupKE7uQcOH6y7q6b3ka3kJY6gpC kf/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=oT0a5RTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 185si2058336pgd.561.2018.04.03.07.59.04; Tue, 03 Apr 2018 07:59:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=oT0a5RTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbeDCO5f (ORCPT + 99 others); Tue, 3 Apr 2018 10:57:35 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:49828 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbeDCO5d (ORCPT ); Tue, 3 Apr 2018 10:57:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BjD2//1TSzT2ZwvS4EctHdL4erMS4mJxuPohC+aoI/s=; b=oT0a5RTePdCEmp4ItBMaiCuQas Gq+qI2HWVo3qF4IxjU+MatHLY28NjolvRtBSXdyoK/dZqmL/cbQzKr4ET3RqEptzXkyebSzobtvtN ncwQVvFijoFPeIIZkU0cOtPPPRKoSTCBTubfEI2WMaHwiI8tcNlQI1DqidxkcTJnGPec=; Date: Tue, 3 Apr 2018 10:58:53 -0400 From: Johannes Weiner To: Michal Hocko Cc: Andrew Morton , David Rientjes , "Kirill A. Shutemov" , Vlastimil Babka , linux-mm@kvack.org, LKML , Michal Hocko Subject: Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges Message-ID: <20180403145853.GB21411@cmpxchg.org> References: <20180321205928.22240-1-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180321205928.22240-1-mhocko@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 09:59:28PM +0100, Michal Hocko wrote: > From: Michal Hocko > > David has noticed that THP memcg charge can trigger the oom killer > since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and > madvised allocations"). We have used an explicit __GFP_NORETRY > previously which ruled the OOM killer automagically. > > Memcg charge path should be semantically compliant with the allocation > path and that means that if we do not trigger the OOM killer for costly > orders which should do the same in the memcg charge path as well. > Otherwise we are forcing callers to distinguish the two and use > different gfp masks which is both non-intuitive and bug prone. Not to > mention the maintenance burden. > > Teach mem_cgroup_oom to bail out on costly order requests to fix the THP > issue as well as any other costly OOM eligible allocations to be added > in future. > > Fixes: 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and madvised allocations") > Reported-by: David Rientjes > Signed-off-by: Michal Hocko I also prefer this fix over having separate OOM behaviors (which is user-visible, and not just about technical ability to satisfy the allocation) between the allocator and memcg. Acked-by: Johannes Weiner