[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230104120345.imuc3pguzyjm5oi4@techsingularity.net>
Date: Wed, 4 Jan 2023 12:03:45 +0000
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Linux-MM <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>, NeilBrown <neilb@...e.de>,
Thierry Reding <thierry.reding@...il.com>,
Matthew Wilcox <willy@...radead.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/6] mm/page_alloc: Give GFP_ATOMIC and non-blocking
allocations access to reserves
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
Powered by blists - more mailing lists