Received: by 10.213.65.68 with SMTP id h4csp3610811imn; Tue, 3 Apr 2018 07:55:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48UzfLlZg+MmsEwWH91lUN5bLntMB0q7Ugg3Cf9RQNPpVNzxVAIgS6+BbVFknS3Puh4kzlC X-Received: by 2002:a17:902:2d24:: with SMTP id o33-v6mr14779007plb.143.1522767323793; Tue, 03 Apr 2018 07:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522767323; cv=none; d=google.com; s=arc-20160816; b=NgJNZmEw+kD/PgcFZWyUn2ngcVN9HnRzW2IfhSrGchbsQz8cg9HATY/TBuIBtL4k9e 7QYvCtO4g0bcU64C3FAhqLgAoRXplXP0RF5e03/Hsd0NKdG4Cqk841UBGjequ/dT2Nxy i+3dsugw7MteVz7RbyI0za34aEXyn2q3Y06/2hhyWVzD0WHvGHATayRIkJxaBUJIgm+n twVfQDMdX3VuveTIqqiT8VI3tKZgHvcuDFMpmflpZdpQZlRpc93CJ2Dqwcm9p1eI0d1W LIHcioDR4gvvUOk+qZixcn1rPxMc05DLOyqr+4IvR01LuMGWwnbYILYybAdVShUDCjJr 3iUQ== 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=oVEIP94x1ybsFgG6xM66zQBEg/4pI392IK4ynhBMddw=; b=u0G/S4i8pbNeXQ7pc6Y0Rn5HWw/uNEf27PwZnF3/idaAgR+FILe/tb7MSH9tooxonp g/GSaHe3Ximi31TxiqMflv7aZvBApNyWaTZobrDbut4BgTC2iPIzW0D57MRG5siq1sbh kKrxJhouyT9s1M1Qes7HaArgAvhuJR8mkaH790yq3UYOJUV3JCxaTSY+vYLWJksO+g6R V8LHyyVH02+HI++icHXkEvP3nWrUmqh6Wh7ekhr+Wpa6GxG9IuLjoZJG4CmVml+HQkP9 1pxjgqjBgaFXB771UxuWbweEysC27xbqYQ6hWoYgsdfk1mJ82vgbTETmNTD663B1/bc0 UnLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=3jsQYp+m; 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 y5si511849pfe.184.2018.04.03.07.55.10; Tue, 03 Apr 2018 07:55:23 -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=3jsQYp+m; 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 S1751869AbeDCOwz (ORCPT + 99 others); Tue, 3 Apr 2018 10:52:55 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:49812 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbeDCOwy (ORCPT ); Tue, 3 Apr 2018 10:52:54 -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=oVEIP94x1ybsFgG6xM66zQBEg/4pI392IK4ynhBMddw=; b=3jsQYp+mLbcb/A/nRUomn+mklT Ajked1mN1sVQfUh8AE+8lWVycrRt8m+2KHl0s4g9kRgI6pGxQQKZaPxxw1AUrmLFOY/mAvz8NUgkp tyec+EY5oap9xqDoMeQNOb6jLiiwmWbpF3Wc4rcMXcUwlWFhQAnVCLmrgGSHEfinqWFE=; Date: Tue, 3 Apr 2018 10:54:08 -0400 From: Johannes Weiner To: David Rientjes Cc: Michal Hocko , Andrew Morton , "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: <20180403145408.GA21411@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: 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 02:22:13PM -0700, David Rientjes wrote: > 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. I agree with your premise: unlike the page allocator, memcg could OOM kill to help satisfy higher order allocations. Technically. But the semantics and expectations matter too. Because of the allocator's restriction, we've been telling and teaching callsites to fail gracefully and implement fallbacks forever, and that makes costly-order allocations inherently speculative and to a certain extent often optional. They've been written with that in mind forever. OOM is not graceful failure, though. We don't want to OOM kill when an the callsite can easily fallback to smaller allocations, trigger a packet resend, fail the syscall, what have you. We could argue what the default should be if callsites aren't specifically annotated - and whether we should change it. But the page allocator has established the default behavior already, and this is a bugfix. I prefer this fix not fundamentally change semantics for costly-order allocations.