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: <053aa2ec-c112-415b-94b6-e4677262d117@redhat.com>
Date: Mon, 15 Sep 2025 10:02:32 +0200
From: David Hildenbrand <david@...hat.com>
To: Balbir Singh <balbirs@...dia.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 13.09.25 01:14, Balbir Singh wrote:
> 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

Ah okay. So it's not required at all in your case because 
MEMORY_DEVICE_PRIVATE is handled through

	if (pgmap->type != MEMORY_DEVICE_FS_DAX &&
	    pgmap->type != MEMORY_DEVICE_GENERIC)
		folio->mapping = NULL;


You using "folio->page.mapping" instead of "folio->mapping" added a bit 
more confusion :)

-- 
Cheers

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ