linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Linux-MM <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>, NeilBrown <neilb@suse.de>,
	Thierry Reding <thierry.reding@gmail.com>,
	Matthew Wilcox <willy@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/6] mm/page_alloc: Give GFP_ATOMIC and non-blocking allocations access to reserves
Date: Wed, 4 Jan 2023 12:03:45 +0000	[thread overview]
Message-ID: <20230104120345.imuc3pguzyjm5oi4@techsingularity.net> (raw)
In-Reply-To: <ebe54af3-f679-32ab-1ef1-17f565796ef2@suse.cz>

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


  reply	other threads:[~2023-01-04 12:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 15:16 [RFC PATCH 0/6] Discard __GFP_ATOMIC Mel Gorman
2022-11-29 15:16 ` [PATCH 1/6] mm/page_alloc: Rename ALLOC_HIGH to ALLOC_MIN_RESERVE Mel Gorman
2022-12-08 16:12   ` Vlastimil Babka
2022-11-29 15:16 ` [PATCH 2/6] mm/page_alloc: Treat RT tasks similar to GFP_HIGH Mel Gorman
2022-12-08 16:16   ` Vlastimil Babka
2022-11-29 15:16 ` [PATCH 3/6] mm/page_alloc: Explicitly record high-order atomic allocations in alloc_flags Mel Gorman
2022-12-05  5:17   ` NeilBrown
2022-12-05 10:27     ` Mel Gorman
2022-12-08 16:51   ` Vlastimil Babka
2023-01-04 11:45     ` Mel Gorman
2022-11-29 15:16 ` [PATCH 4/6] mm/page_alloc: Explicitly define what alloc flags deplete min reserves Mel Gorman
2022-12-08 17:55   ` Vlastimil Babka
2023-01-04 12:02     ` Mel Gorman
2022-11-29 15:17 ` [PATCH 5/6] mm/page_alloc: Give GFP_ATOMIC and non-blocking allocations access to reserves Mel Gorman
2022-12-08 18:07   ` Vlastimil Babka
2023-01-04 12:03     ` Mel Gorman [this message]
2022-11-29 15:17 ` [PATCH 6/6] mm: discard __GFP_ATOMIC Mel Gorman
2022-12-08 18:17   ` Vlastimil Babka
2023-01-04 12:04     ` Mel Gorman
2023-01-05 13:49   ` Mike Rapoport
2023-01-05 21:53     ` NeilBrown
2023-01-06  9:35     ` Mel Gorman
2023-01-08  9:30       ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230104120345.imuc3pguzyjm5oi4@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=neilb@suse.de \
    --cc=thierry.reding@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox