Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp370362ybz; Wed, 29 Apr 2020 01:35:42 -0700 (PDT) X-Google-Smtp-Source: APiQypJfHl8eogM0cgAUm2z19qfSkCY7sonTnS9KbXcoqIDkYPvUWb3Zkq68xWWuJK07YKBbJtGr X-Received: by 2002:a17:906:770b:: with SMTP id q11mr1535824ejm.224.1588149342088; Wed, 29 Apr 2020 01:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588149342; cv=none; d=google.com; s=arc-20160816; b=AmYEB8cTTmw6Q8XbZmZMsYUFQEromadFHOPHXQgmviMomTLs4SgLMmoeUtN7nKujMk TTofRZYVBVHwfv4Rxm6TsrkbilKe45odry3bnw7qDdtwYtjdPhzTUqgcFK1P2EABtD1l M2HVum0BrMoH7eHirVr9X40tDYfgsLAAu7UDGVcQvbpyjVXP/baSJxsDcHPuOK0Uty2G e2yIg3St2j3GPjr87koiemL5ulO1BSt9dP35eiBEYGPtTWpAFy2HlQCc0S5YHRGr4zEa 2y8eHJIdAHLiEhkw9wVnmuIJIetH6iYIsIPwXOmKn5P4zebmhq9zbeQUbiFyFQzpcIR+ Rpkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pWE+aosQQZoSvyukEFjBqg545VUG/9F1LutuR3Mr2Zs=; b=VvjixMQxdOV/VsQbwCedBqycPqraOrqoo103wADHPT+ePppdF45seIWHPHkbWS0k2Q WO9apxramL06oAT1KjmcI7gBFEIFQag0sFvI9wo+bvW6d0qpS975gF7n26LzVPWpyxev aaLb5HL+3FE+NpXYeVGglChRrWO78piAZmUbTHZLD0XxxtLMqzettxXy2SWAJXLj3l0Y fkz9QeI8mbZoz1QU0p/ze3Bd30nX7Pcj8A6DS3xyNtaqZI+iQ91JbcIdbNuXo78GSFae EEcVy1A9Ketf6kh/RakdhDaHKokv7GcFDADF8Cm0VpsJfLZESjwS/q/KFuiJbU9l4nzN Ylbg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks2si3718805ejb.445.2020.04.29.01.35.18; Wed, 29 Apr 2020 01:35:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726539AbgD2Ibp (ORCPT + 99 others); Wed, 29 Apr 2020 04:31:45 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:17564 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbgD2Ibo (ORCPT ); Wed, 29 Apr 2020 04:31:44 -0400 Subject: Re: [patch] mm, oom: stop reclaiming if GFP_ATOMIC will start failing soon To: Michal Hocko , Andrew Morton CC: David Rientjes , Vlastimil Babka , , References: <20200425172706.26b5011293e8dc77b1dccaf3@linux-foundation.org> <20200427133051.b71f961c1bc53a8e72c4f003@linux-foundation.org> <20200427163558.5b08487d63da3cc7a89bf50b@linux-foundation.org> <20200428074301.GK28637@dhcp22.suse.cz> From: peter enderborg Message-ID: <94f9b716-b251-79d8-2c8c-70d63a255496@sony.com> Date: Wed, 29 Apr 2020 10:31:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200428074301.GK28637@dhcp22.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-SEG-SpamProfiler-Analysis: v=2.3 cv=Nc2YKFL4 c=1 sm=1 tr=0 a=kIrCkORFHx6JeP9rmF/Kww==:117 a=IkcTkHD0fZMA:10 a=cl8xLZFz6L8A:10 a=nE2D0_TFZUNrBZwinEYA:9 a=QEXdDO2ut3YA:10 X-SEG-SpamProfiler-Score: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/28/20 9:43 AM, Michal Hocko wrote: > On Mon 27-04-20 16:35:58, Andrew Morton wrote: > [...] >> No consumer of GFP_ATOMIC memory should consume an unbounded amount of >> it. >> Subsystems such as networking will consume a certain amount and >> will then start recycling it. The total amount in-flight will vary >> over the longer term as workloads change. A dynamically tuning >> threshold system will need to adapt rapidly enough to sudden load >> shifts, which might require unreasonable amounts of headroom. > I do agree. __GFP_HIGH/__GFP_ATOMIC are bound by the size of the > reserves under memory pressure. Then allocatios start failing very > quickly and users have to cope with that, usually by deferring to a > sleepable context. Tuning reserves dynamically for heavy reserves > consumers would be possible but I am worried that this is far from > trivial. > > We definitely need to understand what is going on here. Why doesn't > kswapd + N*direct reclaimers do not provide enough memory to satisfy > both N threads + reserves consumers? How many times those direct > reclaimers have to retry? Was this not supposed to be avoided with PSI, user-space should a fair change to take actions before it goes bad in user-space? > We used to have the allocation stall warning as David mentioned in the > patch description and I have seen it triggering without heavy reserves > consumers (aka reported free pages corresponded to the min watermark). > The underlying problem was usually kswapd being stuck on some FS locks, > direct reclaimers stuck in shrinkers or way too overloaded system with > dozens if not hundreds of processes stuck in the page allocator each > racing with the reclaim and betting on luck. The last problem was the > most annoying because it is really hard to tune for.