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: <85033126-c60a-4cac-8f6f-5bd2f6102fec@kernel.org>
Date: Fri, 9 Jan 2026 16:11:23 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Zi Yan <ziy@...dia.com>
Cc: Francois Dugast <francois.dugast@...el.com>,
 intel-xe@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
 Matthew Brost <matthew.brost@...el.com>, Balbir Singh <balbirs@...dia.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>,
 Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>,
 Barry Song <baohua@...nel.org>, Lance Yang <lance.yang@...ux.dev>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 Alistair Popple <apopple@...dia.com>
Subject: Re: [PATCH v3 1/7] mm: Add folio_split_unref helper

On 1/9/26 15:30, Zi Yan wrote:
> On 9 Jan 2026, at 8:26, David Hildenbrand (Red Hat) wrote:
> 
>> On 1/9/26 14:19, David Hildenbrand (Red Hat) wrote:
>>> On 1/9/26 09:54, Francois Dugast wrote:
>>>> From: Matthew Brost <matthew.brost@...el.com>
>>>>
>>>> Add folio_split_unref helper which splits an unreferenced folio
>>>
>>> split_unref reads like "split and unref".
>>>
>>> You probably want to call this something like "folio_split_frozen" ?
>>>
>>> The very definition of "frozen" is "refcount = 0 ", so you can simplify
>>> the documentation.
>>>
>>> Are the folios you want to pass in there completely unused (-> free) or
>>> might they still be in use (e.g., migration entries point at them during
>>> folio split)
>>>
>>> So I am not sure yet if this should be "folio_split_frozen()" or
>>> "folio_split_freed()" or sth like that.
>>>
>>> I'm not CCed on the other patches in the series or the cover letter, so
>>> I don't see the context.
>>>
>>
>> Ah, I was CCed on #3 where we call this function on folios that are getting freed.
>>
>> In that case it would be acceptable to initialize folio->mapping (and folio->index?) of the split folios. Do we also have to initialize folio->flags, folio->private etc?
>>
>> See __split_huge_page_tail().
>>
>> folio_split_freed() would likely be best, because then it is clearer that there is absolutely no state to copy from the large folio.
> 
> Yes, basically, we do not have a reverse function of prep_compound_page() and
> open codes the reverse process in free_pages_prepare(). For zone devices,
> zone_device_page_init() calls prep_compound_page() to form a folio but
> free_zone_device_folio() never does the reverse. FS DAX has its own
> dax_folio_put() to do it. Alistair suggested to come up with a helper
> function for both FS DAX and free_zone_device_folio().
> 
> Maybe free_zone_device_folio_prepare() is better. And put it in mm/memremap.c.

That would be even better, if we can limit this completely to zone_device.
-- 
Cheers

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ