Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5126227yba; Wed, 10 Apr 2019 11:56:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhGDiMtSMmPvZ1UoT4Gq9098G4BRQbAsicQNx3q1cvXEOI7dR+yakJvn+z05TQXS0OSm9J X-Received: by 2002:a17:902:7043:: with SMTP id h3mr46313206plt.228.1554922597324; Wed, 10 Apr 2019 11:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922597; cv=none; d=google.com; s=arc-20160816; b=yURZDrTSuWZ4HU//mR7dlp1LlHIg5HMG72hyWeKx3JndBN5ZuviSOTzNlYPsAMFa4G p6dVHh2Uik6LHiyMM/L0ZxW0WD742j+DYpY1+bpZ6q/46sXXlhRpKa6F2L6zBKNKG5aL NwNOSMrghNCc/j6s9A/7He34eRARvixAHCRoGGbgg0sPPY64tjBa+ESqekfr9hSYu+Go beO2xOdbzxaa8VxO74uxyAVBn8uCCRDIVuyIa61YZWZH0JmFt77eFUh3so+TdkSi3E2a sTkmurN0jmXjFBW7znY5WpPZG6ijrcJXf9SJn/nTCLrLjIHGUb7DRS0D4YlJ/wLMbRYw 7QdA== 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; bh=arxBGNSX0OUYGmyljwVEu7bbeV7OhkzO+FdllTWnzPo=; b=em/drodXALkZouHKQNglSjH47LYsysYTnlJmdPiO6XBkyzINZ9yF9zyG9Z90SWXfLX CsmpIq3Sbgb/gtCgONP2awt2LGEHRk/XNn3Yjq3NbJRtqNtgvxKMGXZ2urMgHgGKyPEm 2E1M+8IBG1kqBIqxiDkZGi1WG/Ykv2iIpXVnYFetfzdu03i9I4GpRD6xqV2jRUbXgn6Q F+iaWrBNt8+jKip1BLoNsWTg2tKZBrxLGqA4i+uUa6353cVA+akvDQHobjBmosI69aMs yt8iaarm1R0pGT2JtHcaM5TYubJeOvNej4d92mcMP2e4Y+tSdgJkRu3cEbyAawvOHNWC Y0/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=xJDIIxl1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si7220467pfc.194.2019.04.10.11.56.21; Wed, 10 Apr 2019 11:56:37 -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=pass header.i=@chrisdown.name header.s=google header.b=xJDIIxl1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731207AbfDJPew (ORCPT + 99 others); Wed, 10 Apr 2019 11:34:52 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34141 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728966AbfDJPew (ORCPT ); Wed, 10 Apr 2019 11:34:52 -0400 Received: by mail-wr1-f66.google.com with SMTP id p10so3540680wrq.1 for ; Wed, 10 Apr 2019 08:34:51 -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:user-agent; bh=arxBGNSX0OUYGmyljwVEu7bbeV7OhkzO+FdllTWnzPo=; b=xJDIIxl1eeL/dAIbEYlOuZSAFwejku7gsZgBW1BS1TBrC2f9JSBLITDJqVqs0PSeI4 maDchJybAJdG0zBjinmp9wRxhX9DKa0H/MmG6XAo+vD62eSzMbE6SshIV9gtBlg76KPQ 89iiOrmmBwbKuVrud8G0hORSsuQSWFNviuPfM= 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:user-agent; bh=arxBGNSX0OUYGmyljwVEu7bbeV7OhkzO+FdllTWnzPo=; b=Vs68rs/HbDsAitkeysw9lTORgRzrKinuMltAFLV0ypZm2kN3+QCt6gWpYtzA+G9Gbn QgwDTYUvjefwe/FmVG3g4NUK6yATFulXe9kka7H2uVuoQ53obT/mvxQm8gQD+1R9ZpjZ GEldK7nqFHnJLlHSBjIB/uQJTGY7QaTbnoIFNAHySUYsqooYwGqYD8Hr/LUZk7hhSWp+ eeBPPWZhHhg2aD1+YPcqxfTqwE8ZlnqXq1WqmJaP9qf6el4goIC28a8tRCC3iYlOGdys Gfo9hRaPXByfOxmVvbhnott+Ciy9TZ5yDllpwYb44cJeOaHnDfuON3X/VqnwUwcjR46b Sadw== X-Gm-Message-State: APjAAAXgqIaG1Bq8HzzOK2zo8rYOUAUxTbnnZbiVQtmZdaiv4z8sEwqT Rncepo8aHvx7SFJt7vnCHxdLOg== X-Received: by 2002:adf:f050:: with SMTP id t16mr23381660wro.198.1554910490281; Wed, 10 Apr 2019 08:34:50 -0700 (PDT) Received: from localhost ([2620:10d:c092:200::1:4ff4]) by smtp.gmail.com with ESMTPSA id 7sm122837004wrc.81.2019.04.10.08.34.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2019 08:34:49 -0700 (PDT) Date: Wed, 10 Apr 2019 16:34:49 +0100 From: Chris Down To: Michal Hocko Cc: Johannes Weiner , Tejun Heo , Roman Gushchin , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com, Andrew Morton Subject: Re: [PATCH REBASED] mm: Throttle allocators when failing reclaim over memory.high Message-ID: <20190410153449.GA14915@chrisdown.name> References: <20190201191636.GA17391@chrisdown.name> <20190410153307.GA11122@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190410153307.GA11122@chrisdown.name> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Michal, Just to come back to your last e-mail about how this interacts with OOM. Michal Hocko writes: > I am not really opposed to the throttling in the absence of a reclaimable > memory. We do that for the regular allocation paths already > (should_reclaim_retry). A swapless system with anon memory is very likely to > oom too quickly and this sounds like a real problem. But I do not think that > we should throttle the allocation to freeze it completely. We should > eventually OOM. And that was my question about essentially. How much we > can/should throttle to give a high limit events consumer enough time to > intervene. I am sorry to still not have time to study the patch more closely > but this should be explained in the changelog. Are we talking about > seconds/minutes or simply freeze each allocator to death? Per-allocation, the maximum is 2 seconds (MEMCG_MAX_HIGH_DELAY_JIFFIES), so we don't freeze things to death -- they can recover if they are amenable to it. The idea here is that primarily you handle it, just like memory.oom_control in v1 (as mentioned in the commit message, or as a last resort, the kernel will still OOM if our userspace daemon has kicked the bucket or is otherwise ineffective. If you're setting memory.high and memory.max together, then setting memory.high always has to come with a.) tolerance of heavy throttling by your application, and b.) userspace intervention in the case of high memory pressure resulting. This patch doesn't really change those semantics.