lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240822113634.1aaf99c506796ecc233cb472@linux-foundation.org>
Date: Thu, 22 Aug 2024 11:36:34 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Yu Liao <liaoyu15@...wei.com>
Cc: Yu Zhao <yuzhao@...gle.com>, Muchun Song <muchun.song@...ux.dev>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>, Zi Yan <ziy@...dia.com>,
 <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>, Kefeng Wang
 <wangkefeng.wang@...wei.com>
Subject: Re: [PATCH mm-unstable v2 1/3] mm/contig_alloc: support __GFP_COMP

On Thu, 22 Aug 2024 16:21:27 +0800 Yu Liao <liaoyu15@...wei.com> wrote:

> > +#ifdef CONFIG_CONTIG_ALLOC
> > +static inline struct folio *folio_alloc_gigantic_noprof(int order, gfp_t gfp,
> > +							int nid, nodemask_t *node)
> > +{
> > +	struct page *page;
> > +
> > +	if (WARN_ON(!order || !(gfp | __GFP_COMP)))
> 
> It doesn't seem right, it should be !(gfp & __GFP_COMP).

Yup.  Although I'm wondering why we're checking __GFP_COMP at all? 
It's a gigantic page - we know it's compound, so why require that the
caller tell us something we already know?

--- a/include/linux/gfp.h~mm-contig_alloc-support-__gfp_comp-fix
+++ a/include/linux/gfp.h
@@ -452,7 +452,7 @@ static inline struct folio *folio_alloc_
 {
 	struct page *page;
 
-	if (WARN_ON(!order || !(gfp | __GFP_COMP)))
+	if (WARN_ON(!order || !(gfp & __GFP_COMP)))
 		return NULL;
 
 	page = alloc_contig_pages_noprof(1 << order, gfp, nid, node);
_



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ