Re: [PATCH] mm/huge_memory.c: introduce split_unmapped_folio_to_order
From: David Hildenbrand (Red Hat)
Date: Thu Nov 13 2025 - 14:07:32 EST
On 13.11.25 17:24, Zi Yan wrote:
On 13 Nov 2025, at 11:02, Lorenzo Stoakes wrote:
On Thu, Nov 13, 2025 at 04:36:01PM +0100, Francois Dugast wrote:
Hi Balbir,
On Wed, Nov 12, 2025 at 03:46:33PM +1100, Balbir Singh wrote:
Unmapped was added as a parameter to __folio_split() and related
call sites to support splitting of folios already in the midst
of a migration. This special case arose for device private folio
migration since during migration there could be a disconnect between
source and destination on the folio size.
Introduce split_unmapped_folio_to_order() to handle this special case.
This in turn removes the special casing introduced by the unmapped
parameter in __folio_split().
Such a helper would be needed in drm_pagemap_migrate_to_devmem when
reallocating a device folio to smaller pages.
Could we export it (EXPORT_SYMBOL)?
drm_pagemap_migrate_to_devmem() is a function defined in tree, you
just need to include huge_mm.h to use split_unmapped_folio_to_order().
Why do you need to export split_unmapped_folio_to_order()?
I guess because DRM_GPUSVM is tristate, so can be built as a module. IIUC, that's where drm_pagemap_migrate_to_devmem() ends up.
As a rule we don't export things from core mm. And certainly not to non-GPL
modules.
Unless David feels very differently or there's some enormously compelling
reason for it I'd really rather we didn't.
We'd need a pretty good reason to go down that path indeed :)
--
Cheers
David