From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41F48C83003 for ; Wed, 29 Apr 2020 09:00:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0EC3A2076B for ; Wed, 29 Apr 2020 09:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EC3A2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A07338E0006; Wed, 29 Apr 2020 05:00:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9902E8E0001; Wed, 29 Apr 2020 05:00:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 880448E0006; Wed, 29 Apr 2020 05:00:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 70B818E0001 for ; Wed, 29 Apr 2020 05:00:49 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 28FDF8248047 for ; Wed, 29 Apr 2020 09:00:49 +0000 (UTC) X-FDA: 76760297418.09.wren12_7b83d6a902d1f X-HE-Tag: wren12_7b83d6a902d1f X-Filterd-Recvd-Size: 4413 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 09:00:48 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id z6so1137073wml.2 for ; Wed, 29 Apr 2020 02:00:48 -0700 (PDT) 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=aFWKpwDYdj0bi9LcW9uHrGndjd6KiGSzaHWUYSzaL0w=; b=Zuuu2Nq/nthC3BGk3Tty99ER0BdDB6obz/YGqLhuaJwCs3nbPIcVZVtLOvOjcKbOCJ MjoDTVchEnPMYmGg8JfoxNWTaPS8eQUuAlN/EOWQrGlE6bx5IbAY6PgiZfZNH0RXVTo/ /7l5mthnEEvssVtDnMg0AiC5B8FxnVJpm5vPch1ne1OoiHOyEZTP1Pm9aUYpw/pm4uUu 5jM57Q0p0Chq/uDFeQjdJRmi3oTqzFomqbB644kS6axkaU79xd+jYaXJdV58vx9gY8rq vqHBgvQ8EUAJjaHJT9bggeQLOKOiYTvFrXuhAkNEZAR22NKWEHDaBHP7Qc4mFDnv0X8a wJ8Q== X-Gm-Message-State: AGi0PubKMRPxX9aqmqpLY6cJol5ck4GnXh/GChderFvzLRyLTm+DrDUh 4NHrjfLrBVGYFOTPiTqMTOs= X-Google-Smtp-Source: APiQypKhm2pknR3kic67AlinqfHRhuuiLKc2SzzCco52awaQIbhagtaRRCfaA9cGxv1D/yNJfeFWxQ== X-Received: by 2002:a1c:7f86:: with SMTP id a128mr2024417wmd.95.1588150847575; Wed, 29 Apr 2020 02:00:47 -0700 (PDT) Received: from localhost (ip-37-188-130-62.eurotel.cz. [37.188.130.62]) by smtp.gmail.com with ESMTPSA id f18sm32723955wrq.29.2020.04.29.02.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 02:00:46 -0700 (PDT) Date: Wed, 29 Apr 2020 11:00:45 +0200 From: Michal Hocko To: peter enderborg Cc: Andrew Morton , David Rientjes , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch] mm, oom: stop reclaiming if GFP_ATOMIC will start failing soon Message-ID: <20200429090045.GW28637@dhcp22.suse.cz> References: <20200425172706.26b5011293e8dc77b1dccaf3@linux-foundation.org> <20200427133051.b71f961c1bc53a8e72c4f003@linux-foundation.org> <20200427163558.5b08487d63da3cc7a89bf50b@linux-foundation.org> <20200428074301.GK28637@dhcp22.suse.cz> <94f9b716-b251-79d8-2c8c-70d63a255496@sony.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94f9b716-b251-79d8-2c8c-70d63a255496@sony.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 29-04-20 10:31:41, peter enderborg wrote: > 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? Yes, PSI is certainly a tool to help userspace make actions on heavy reclaim. And I agree that if there is a desire to trigger the oom killer early as David states elsewhere in the thread then this approach should be considered. -- Michal Hocko SUSE Labs