Re: [v5 01/15] mm/zone_device: support large zone device private folios
From: Balbir Singh
Date: Fri Sep 12 2025 - 00:49:26 EST
On 9/11/25 22:52, David Hildenbrand wrote:
> On 11.09.25 14:49, Balbir Singh wrote:
>> On 9/11/25 21:45, David Hildenbrand wrote:
>>> On 08.09.25 02:04, Balbir Singh wrote:
>>>> Add routines to support allocation of large order zone device folios
>>>> and helper functions for zone device folios, to check if a folio is
>>>> device private and helpers for setting zone device data.
>>>>
>>>> When large folios are used, the existing page_free() callback in
>>>> pgmap is called when the folio is freed, this is true for both
>>>> PAGE_SIZE and higher order pages.
>>>>
>>>> Zone device private large folios do not support deferred split and
>>>> scan like normal THP folios.
>>>>
>>>> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>>>> Cc: David Hildenbrand <david@xxxxxxxxxx>
>>>> Cc: Zi Yan <ziy@xxxxxxxxxx>
>>>> Cc: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
>>>> Cc: Rakie Kim <rakie.kim@xxxxxx>
>>>> Cc: Byungchul Park <byungchul@xxxxxx>
>>>> Cc: Gregory Price <gourry@xxxxxxxxxx>
>>>> Cc: Ying Huang <ying.huang@xxxxxxxxxxxxxxxxx>
>>>> Cc: Alistair Popple <apopple@xxxxxxxxxx>
>>>> Cc: Oscar Salvador <osalvador@xxxxxxx>
>>>> Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
>>>> Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
>>>> Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
>>>> Cc: Nico Pache <npache@xxxxxxxxxx>
>>>> Cc: Ryan Roberts <ryan.roberts@xxxxxxx>
>>>> Cc: Dev Jain <dev.jain@xxxxxxx>
>>>> Cc: Barry Song <baohua@xxxxxxxxxx>
>>>> Cc: Lyude Paul <lyude@xxxxxxxxxx>
>>>> Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
>>>> Cc: David Airlie <airlied@xxxxxxxxx>
>>>> Cc: Simona Vetter <simona@xxxxxxxx>
>>>> Cc: Ralph Campbell <rcampbell@xxxxxxxxxx>
>>>> Cc: Mika Penttilä <mpenttil@xxxxxxxxxx>
>>>> Cc: Matthew Brost <matthew.brost@xxxxxxxxx>
>>>> Cc: Francois Dugast <francois.dugast@xxxxxxxxx>
>>>>
>>>> Signed-off-by: Balbir Singh <balbirs@xxxxxxxxxx>
>>>> ---
>>>
>>> You missed my comments of this patch in v3.
>>>
>>
>> Hi, David
>>
>> Looks I missed your comments, just checked those were largely about alignment and
>> integrating the code for DEVICE_COHERENT and DEVICE_PRIVATE cases into similar looking
>> bits for zone device folio free and code-alignment. I'll take a look and update as needed.
>
> Yes, and the confusing folio->mapping = NULL that I cannot connect to THP support.
>
I can remove that, let me reunify those bits, seems relatively straight forward
Balbir