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: <01AA2C89-9E6B-4C9D-9072-147FAA5DE7C1@nvidia.com>
Date: Sat, 31 Jan 2026 21:04:53 -0500
From: Zi Yan <ziy@...dia.com>
To: Lance Yang <lance.yang@...ux.dev>
Cc: Alistair Popple <apopple@...dia.com>, Balbir Singh <balbirs@...dia.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>,
 Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
 Matthew Wilcox <willy@...radead.org>, Suren Baghdasaryan <surenb@...gle.com>,
 Jason Gunthorpe <jgg@...dia.com>, Michal Hocko <mhocko@...e.com>,
 Jens Axboe <axboe@...nel.dk>, David Hildenbrand <david@...nel.org>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>, Nico Pache <npache@...hat.com>,
 Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>,
 Barry Song <baohua@...nel.org>, Muchun Song <muchun.song@...ux.dev>,
 Oscar Salvador <osalvador@...e.de>, Brendan Jackman <jackmanb@...gle.com>,
 Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, io-uring@...r.kernel.org
Subject: Re: [RFC PATCH 1/5] io_uring: allocate folio in
 io_mem_alloc_compound() and function rename

On 31 Jan 2026, at 10:30, Lance Yang wrote:

> On 2026/1/30 11:48, Zi Yan wrote:
>> The page allocated in io_mem_alloc_compound() is actually used as a folio
>> later in io_region_mmap(). So allocate a folio instead of a compound page
>> and rename io_mem_alloc_compound() to io_mem_alloc_folio().
>>
>> This prepares for code separation of compound page and folio in a follow-up
>> commit.
>>
>> Signed-off-by: Zi Yan <ziy@...dia.com>
>> ---
>>   io_uring/memmap.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/io_uring/memmap.c b/io_uring/memmap.c
>> index 7d3c5eb58480..8ed8a78d71cc 100644
>> --- a/io_uring/memmap.c
>> +++ b/io_uring/memmap.c
>> @@ -15,10 +15,10 @@
>>   #include "rsrc.h"
>>   #include "zcrx.h"
>>  -static bool io_mem_alloc_compound(struct page **pages, int nr_pages,
>> +static bool io_mem_alloc_folio(struct page **pages, int nr_pages,
>>   				  size_t size, gfp_t gfp)
>>   {
>> -	struct page *page;
>> +	struct folio *folio;
>>   	int i, order;
>>    	order = get_order(size);
>> @@ -27,12 +27,12 @@ static bool io_mem_alloc_compound(struct page **pages, int nr_pages,
>
> Nit:
>
>>   	else if (order)
>>   		gfp |= __GFP_COMP;
>
> Since we're switching to folio_alloc(), which already adds __GFP_COMP
> internally, the "else if (order)" part above can be dropped while at it.
>
> IIUC, for order == 0, __GFP_COMP gets ignored anyway:
>
>  - prep_new_page() won't call prep_compound_page() (since order is zero)
>  - page_rmappable_folio() sees a non-compound page and does nothing
>
> So no behavior change there :)
>
Sure. Will update it in the next version. Thanks.

--
Best Regards,
Yan, Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ