Re: [v1 resend 07/12] mm/memremap: add folio_split support

From: Balbir Singh
Date: Sat Jul 05 2025 - 21:25:08 EST


On 7/4/25 21:14, Mika Penttilä wrote:
>
> On 7/4/25 02:35, Balbir Singh wrote:
>>
>> + if (folio_is_device_private(origin_folio) &&
>> + origin_folio->pgmap->ops->folio_split)
>> + origin_folio->pgmap->ops->folio_split(
>> + origin_folio, release);
>
> Should folio split fail if pgmap->ops->folio_split() is not defined? If not then at least the >pgmap pointer copy should be in the common code.
>

We could change the code can check ->folio_split callback is not NULL when MIGRATE_VMA_SELECT_COMPOUND is used and cause migrate_vma to fail

Providing a default implementation might surprise drivers about the split

Balbir Singh