From: Yu Zhao <yuzhao@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <muchun.song@linux.dev>, Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm-unstable v2 1/3] mm/contig_alloc: support __GFP_COMP
Date: Mon, 2 Sep 2024 11:02:46 -0600 [thread overview]
Message-ID: <ZtXvtnc2Cf8xWU7d@google.com> (raw)
In-Reply-To: <ZseGjKXaZIvgu9vQ@casper.infradead.org>
On Thu, Aug 22, 2024 at 07:42:20PM +0100, Matthew Wilcox wrote:
> On Thu, Aug 22, 2024 at 11:23:04AM -0600, Yu Zhao wrote:
> > Andrew, could you patch up the line above? This is what it's supposed
> > to check:
> >
> > diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> > index 59266df56aeb..03ba9563c6db 100644
> > --- a/include/linux/gfp.h
> > +++ b/include/linux/gfp.h
> > @@ -452,7 +452,7 @@ static inline struct folio *folio_alloc_gigantic_noprof(int order, gfp_t gfp,
> > {
> > struct page *page;
> >
> > - if (WARN_ON(!order || !(gfp | __GFP_COMP)))
> > + if (WARN_ON(!order || !(gfp & __GFP_COMP)))
> > return NULL;
>
> I don't think we should do this at all. Just this should be enough:
>
> gfp |= __GFP_COMP;
>
> same as folio_alloc() (or now folio_alloc_noprof()).
> Do we really caree if somebody tries to allocate a gigantic page with an
> order of 0?
If this ever happens, I'd bet it's a bug.
> It's weird, but would work, so I don't see the need for the
> warning.
So the warning could catch that, but if we think it's verbose, then
please fold the following in:
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index a951de920e20..b43934d79dd9 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -452,10 +452,7 @@ static inline struct folio *folio_alloc_gigantic_noprof(int order, gfp_t gfp,
{
struct page *page;
- if (WARN_ON(!order || !(gfp & __GFP_COMP)))
- return NULL;
-
- page = alloc_contig_pages_noprof(1 << order, gfp, nid, node);
+ page = alloc_contig_pages_noprof(1 << order, gfp | __GFP_COMP, nid, node);
return page ? page_folio(page) : NULL;
}
next prev parent reply other threads:[~2024-09-02 17:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 3:54 [PATCH mm-unstable v2 0/3] mm/hugetlb: alloc/free gigantic folios Yu Zhao
2024-08-14 3:54 ` [PATCH mm-unstable v2 1/3] mm/contig_alloc: support __GFP_COMP Yu Zhao
2024-08-22 8:21 ` Yu Liao
2024-08-22 17:25 ` Yu Zhao
2024-08-22 18:36 ` Andrew Morton
2024-08-22 17:23 ` Yu Zhao
2024-08-22 18:42 ` Matthew Wilcox
2024-09-02 17:02 ` Yu Zhao [this message]
2024-11-19 15:29 ` David Hildenbrand
2024-11-19 16:12 ` Zi Yan
2024-11-19 16:25 ` David Hildenbrand
2024-11-19 16:31 ` David Hildenbrand
2024-11-19 16:41 ` Zi Yan
2024-11-19 16:49 ` David Hildenbrand
2024-11-19 16:52 ` David Hildenbrand
2024-11-20 15:55 ` Zi Yan
2024-11-20 16:13 ` David Hildenbrand
2024-11-20 16:46 ` Zi Yan
2024-08-14 3:54 ` [PATCH mm-unstable v2 2/3] mm/cma: add cma_{alloc,free}_folio() Yu Zhao
2024-08-22 17:24 ` Yu Zhao
2024-09-02 17:04 ` Yu Zhao
2024-08-14 3:54 ` [PATCH mm-unstable v2 3/3] mm/hugetlb: use __GFP_COMP for gigantic folios Yu Zhao
2024-08-16 15:23 ` Zi Yan
2024-08-16 16:02 ` Yu Zhao
2024-08-16 16:30 ` Zi Yan
2024-08-30 17:55 ` [PATCH mm-unstable v2 0/3] mm/hugetlb: alloc/free " jane.chu
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=ZtXvtnc2Cf8xWU7d@google.com \
--to=yuzhao@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).