Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1401541ybk; Thu, 21 May 2020 06:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwGv2uHlGj7hXW+JcCzguD0oxjr3keKURoLgxVqbAzsULD905BnOHyPEgrtU7o4qj/Xau8 X-Received: by 2002:a17:906:8cf:: with SMTP id o15mr3324470eje.351.1590066502877; Thu, 21 May 2020 06:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590066502; cv=none; d=google.com; s=arc-20160816; b=CvM1nxtIAzcn6g5jrcJIuaVxOHwmcz6P67zvZFKVNIwFQ1lWvJVa1UiUuYmGXrvtDu BrYanAo9jx4VpkgDb2Ek1Slj52en377YZB3frHftupHudhGLfZy6FqC/8JGuFF85kdSX yXhebL++LPrm7jN2JHWLfgc9EcfItkvYu7qA/N3B5pOxEqEJ3+7svSDYbnPc+WQBALAF TbUFll8kye+s2AZjp42Ugrp0yBERTtf1pe420eXhB5EVtA94INRyJbNSmtKWo/NTbpqD O36U6aaJVQwFtkHdRdkATOT52cpDKY2roLqRv+ZFMOJKvO+IkmaEzFU0vTVxZ9K5OBCu zW0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lIVlACF4LDO220gEGSvhc/aauhEeT3bDk/ER46APYDY=; b=1FeouoTqZdxoQRItur3Sb0AqMIimTHToTIgVcjZoWQrivxqVAHP7juXne6JmoG08UH 3CbDVXY53SXPpVM0d7ey+eTi3TiZcsBW7MhEHydKJiCsJzAYqLnxkZBy8j8ad1y5MSZm p9A9vTDjuxl9NKS/5FlM0LmNHdn/ZAshwZln2j/d7AbtokxzostekcSMHzxASdvdObBh e6Gk8ur3MZzZho4d4pTCVXEvnP+KLUywe/K1GGVsCEqjRi3WT3XNux2W+8T+rG8aKm2Q kiIdxLLw9u1zk7swjNFrils0YZly1CkgFQ6JE4wjal6VSdhA8NVbzCafWA64MTfUSO7H QhMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=lm15zqD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n21si2663301ejg.267.2020.05.21.06.07.52; Thu, 21 May 2020 06:08:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=lm15zqD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgEUNFg (ORCPT + 99 others); Thu, 21 May 2020 09:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729197AbgEUNFd (ORCPT ); Thu, 21 May 2020 09:05:33 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6ADC061A0F for ; Thu, 21 May 2020 06:05:33 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id s19so6576515edt.12 for ; Thu, 21 May 2020 06:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lIVlACF4LDO220gEGSvhc/aauhEeT3bDk/ER46APYDY=; b=lm15zqD7bQsCw4wiTNv6NzVw1jCgcLOsWTU1x6wfuW5NkSlsXD99ZPhpzoFHTLPOU8 b29eUZlH28mu05WYQ2aUGv31+3wJp8CLc5ANp+8VlL/Yd5xKTarIVPKSxWu3uJWSpvsU I9xvM12xty15SeSsxedimd/k5ql9zjCbFIxvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lIVlACF4LDO220gEGSvhc/aauhEeT3bDk/ER46APYDY=; b=UZOofYKmPAozKX3Xwn8WG0MjDvIHc9hN+Y7NPA9kmYQiftrdtMyAYI/+bundPP/SUr FEcoCFZFm0HHZmBjrVWbzd12rVjPQ+2hI6CoisNJ19gprcopNzsHxSHoXvgSUripkVPn SFLPkMHRX1DYE+uESm37UzL4Y4JwYNCgoAZIJRHyGTDw2Xuq9iLQj0JiFtolRPasDdJE 9EMIY/JxfcXRcv9N6Kn5NRfO3/LbPDpECmLidEWzF92Wui+NStf9GN/DhoKSRAZwDO2R 6AbEib/Xiw4YXbv5u01rjIkXptlD12uT/T8EcQC4MnWSVw/pEmQU/M4K5rlx/t0XHD4a C+Jw== X-Gm-Message-State: AOAM530J85OtoR6KVuvPwV/1kxOMx7aoLYTOH4cKElQVyZF5c/K9M73w 8V3bXwtaunXMOWah71zNhd3W/Q== X-Received: by 2002:aa7:d1c6:: with SMTP id g6mr7728524edp.303.1590066331942; Thu, 21 May 2020 06:05:31 -0700 (PDT) Received: from localhost ([2620:10d:c093:400::5:4262]) by smtp.gmail.com with ESMTPSA id r1sm4850187ejz.59.2020.05.21.06.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 06:05:31 -0700 (PDT) Date: Thu, 21 May 2020 14:05:30 +0100 From: Chris Down To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling Message-ID: <20200521130530.GE990580@chrisdown.name> References: <20200520143712.GA749486@chrisdown.name> <20200520160756.GE6462@dhcp22.suse.cz> <20200520202650.GB558281@chrisdown.name> <20200521071929.GH6462@dhcp22.suse.cz> <20200521112711.GA990580@chrisdown.name> <20200521120455.GM6462@dhcp22.suse.cz> <20200521122327.GB990580@chrisdown.name> <20200521123742.GO6462@dhcp22.suse.cz> <20200521125759.GD990580@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200521125759.GD990580@chrisdown.name> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Chris Down writes: >>I believe I have asked in other email in this thread. Could you explain >>why enforcint the requested target (memcg_nr_pages_over_high) is >>insufficient for the problem you are dealing with? Because that would >>make sense for large targets to me while it would keep relatively >>reasonable semantic of the throttling - aka proportional to the memory >>demand rather than the excess. > >memcg_nr_pages_over_high is related to the charge size. As such, if >you're way over memory.high as a result of transient reclaim failures, >but the majority of your charges are small, it's going to hard to make >meaningful progress: > >1. Most nr_pages will be MEMCG_CHARGE_BATCH, which is not enough to help; >2. Large allocations will only get a single reclaim attempt to succeed. > >As such, in many cases we're either doomed to successfully reclaim a >paltry amount of pages, or fail to reclaim a lot of pages. Asking >try_to_free_pages() to deal with those huge allocations is generally >not reasonable, regardless of the specifics of why it doesn't work in >this case. Oh, I somehow elided the "enforcing" part of your proposal. Still, there's no guarantee even if large allocations are reclaimed fully that we will end up going back below memory.high, because even a single other large allocation which fails to reclaim can knock us out of whack again.