[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <227ee2b2-3c1f-449f-98f1-29bde663bfdf@nvidia.com>
Date: Sat, 13 Sep 2025 09:14:29 +1000
From: Balbir Singh <balbirs@...dia.com>
To: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: damon@...ts.linux.dev, dri-devel@...ts.freedesktop.org,
Andrew Morton <akpm@...ux-foundation.org>, Zi Yan <ziy@...dia.com>,
Joshua Hahn <joshua.hahnjy@...il.com>, Rakie Kim <rakie.kim@...com>,
Byungchul Park <byungchul@...com>, Gregory Price <gourry@...rry.net>,
Ying Huang <ying.huang@...ux.alibaba.com>,
Alistair Popple <apopple@...dia.com>, Oscar Salvador <osalvador@...e.de>,
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>, Lyude Paul <lyude@...hat.com>,
Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Ralph Campbell <rcampbell@...dia.com>,
Mika Penttilä <mpenttil@...hat.com>,
Matthew Brost <matthew.brost@...el.com>,
Francois Dugast <francois.dugast@...el.com>
Subject: Re: [v5 01/15] mm/zone_device: support large zone device private
folios
On 9/12/25 19:20, David Hildenbrand wrote:
> On 12.09.25 06:49, Balbir Singh wrote:
>> 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@...ux-foundation.org>
>>>>>> Cc: David Hildenbrand <david@...hat.com>
>>>>>> Cc: Zi Yan <ziy@...dia.com>
>>>>>> Cc: Joshua Hahn <joshua.hahnjy@...il.com>
>>>>>> Cc: Rakie Kim <rakie.kim@...com>
>>>>>> Cc: Byungchul Park <byungchul@...com>
>>>>>> Cc: Gregory Price <gourry@...rry.net>
>>>>>> Cc: Ying Huang <ying.huang@...ux.alibaba.com>
>>>>>> Cc: Alistair Popple <apopple@...dia.com>
>>>>>> Cc: Oscar Salvador <osalvador@...e.de>
>>>>>> Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
>>>>>> Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
>>>>>> Cc: "Liam R. Howlett" <Liam.Howlett@...cle.com>
>>>>>> Cc: Nico Pache <npache@...hat.com>
>>>>>> Cc: Ryan Roberts <ryan.roberts@....com>
>>>>>> Cc: Dev Jain <dev.jain@....com>
>>>>>> Cc: Barry Song <baohua@...nel.org>
>>>>>> Cc: Lyude Paul <lyude@...hat.com>
>>>>>> Cc: Danilo Krummrich <dakr@...nel.org>
>>>>>> Cc: David Airlie <airlied@...il.com>
>>>>>> Cc: Simona Vetter <simona@...ll.ch>
>>>>>> Cc: Ralph Campbell <rcampbell@...dia.com>
>>>>>> Cc: Mika Penttilä <mpenttil@...hat.com>
>>>>>> Cc: Matthew Brost <matthew.brost@...el.com>
>>>>>> Cc: Francois Dugast <francois.dugast@...el.com>
>>>>>>
>>>>>> Signed-off-by: Balbir Singh <balbirs@...dia.com>
>>>>>> ---
>>>>>
>>>>> 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
>
> BTW, I was wondering when we invalidate folio_test_anon() by clearing folio->mapping int he current code flow?
>
> I mean, this must happen at some point when freeing device folios.
>
The free_zone_device_folio() code does that. Lines 434 onwards there is a comment that explains it
Balbir
Powered by blists - more mailing lists