Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13145126rwl; Wed, 4 Jan 2023 04:16:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXudFxCpTYTKDoTF+vAwfvmAoR2BPctTx1A6/GPG0Q3GxahwMcrLONq9OgXdwAd1WNVGyiom X-Received: by 2002:a17:906:6693:b0:7c1:8ba7:3182 with SMTP id z19-20020a170906669300b007c18ba73182mr46212841ejo.69.1672834598853; Wed, 04 Jan 2023 04:16:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672834598; cv=none; d=google.com; s=arc-20160816; b=txjT+Mnb5IGTQZsk/akWpHP35vRapCA2M0qBx5PHHbJoa72cuaK+ptQiqzGp1StFts ne5F5/bOIwoPUV9NFK68gUrauSzHm8Pyb7vhhqj7g/+lTLZD//1ZCKs1HC7Z20Y5Qpow kekO40khjdAvZBvNSvaUq7iJI3lE9J7qB7bhejWwcyxNDzDmJLcik861urcUGkSJYwSF 7zfFuYAvm0b7u5rudARmPIg6mY/c02BCp3AhGkzLcVTy87OiDmk41sbaJxzXNrFvZXmX Rlxsaaaa8QatBMBQctxIbztHRsHAPDozyHJQNfR7ZJ2gGpdB+1tM/kzuONfeit3WVzq4 /KXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=WS9AkiOJEglBQzS1TvCc+BWrnal6YlhtabWMfuS4QZo=; b=cmNn8PwOvbND1KYWtNjm9dCT/2vJXHuEp6hgkUkvC4PtiUYcd9VIQX9oPjVbCiO4mF v9XZPPt3teYtBI3fCnM8/lDtvt5R2SoK1+fFFiw4lP7VIZ+htTsfvgSujpVphlKYRAis hkVlWz8lSI4RKxwBLmEXgipbck3NWx6EZvX/VicI+PGKdIhpK4dqu78oJqTY0N9zPbzA bFM/pT3NaJaQcQI2JDQbZYY4zfurR94wOHIbOWNTJ7LSxtSIf9d3o1H5Eg3LSZxAvjg+ liDYutF9gFuhgL6XTvvyRpu/r/pxU8eMEk9AXivDdfi1fBHGWQSdOzc3LXGwlsZBd64c avPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn16-20020a17090794d000b0084514612c2fsi33147778ejc.613.2023.01.04.04.16.24; Wed, 04 Jan 2023 04:16:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239229AbjADME1 (ORCPT + 59 others); Wed, 4 Jan 2023 07:04:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234427AbjADMEE (ORCPT ); Wed, 4 Jan 2023 07:04:04 -0500 Received: from outbound-smtp57.blacknight.com (outbound-smtp57.blacknight.com [46.22.136.241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6923219E for ; Wed, 4 Jan 2023 04:03:49 -0800 (PST) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp57.blacknight.com (Postfix) with ESMTPS id E4D68FACEE for ; Wed, 4 Jan 2023 12:03:47 +0000 (GMT) Received: (qmail 18400 invoked from network); 4 Jan 2023 12:03:47 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 4 Jan 2023 12:03:47 -0000 Date: Wed, 4 Jan 2023 12:03:45 +0000 From: Mel Gorman To: Vlastimil Babka Cc: Linux-MM , Andrew Morton , Michal Hocko , NeilBrown , Thierry Reding , Matthew Wilcox , LKML Subject: Re: [PATCH 5/6] mm/page_alloc: Give GFP_ATOMIC and non-blocking allocations access to reserves Message-ID: <20230104120345.imuc3pguzyjm5oi4@techsingularity.net> References: <20221129151701.23261-1-mgorman@techsingularity.net> <20221129151701.23261-6-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 08, 2022 at 07:07:06PM +0100, Vlastimil Babka wrote: > On 11/29/22 16:17, Mel Gorman wrote: > > @@ -4846,28 +4846,30 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order) > > * The caller may dip into page reserves a bit more if the caller > > * cannot run direct reclaim, or if the caller has realtime scheduling > > * policy or is asking for __GFP_HIGH memory. GFP_ATOMIC requests will > > - * set both ALLOC_HARDER (__GFP_ATOMIC) and ALLOC_MIN_RESERVE(__GFP_HIGH). > > + * set both ALLOC_NON_BLOCK and ALLOC_MIN_RESERVE(__GFP_HIGH). > > */ > > alloc_flags |= (__force int) > > (gfp_mask & (__GFP_HIGH | __GFP_KSWAPD_RECLAIM)); > > > > - if (gfp_mask & __GFP_ATOMIC) { > > + if (!(gfp_mask & __GFP_RECLAIM)) { > > This is supposed to be __GFP_DIRECT_RECLAIM right? Otherwise that includes > also __GFP_KSWAPD_RECLAIM and GFP_ATOMIC sets that one... > Yes diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0b2093d17b48..2217bab2dbb2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4856,7 +4856,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order) alloc_flags |= (__force int) (gfp_mask & (__GFP_HIGH | __GFP_KSWAPD_RECLAIM)); - if (!(gfp_mask & __GFP_RECLAIM)) { + if (!(gfp_mask & __GFP_DIRECT_RECLAIM)) { /* * Not worth trying to allocate harder for __GFP_NOMEMALLOC even * if it can't schedule. -- Mel Gorman SUSE Labs