Re: [PATCH] mm/migrate_device: fix cache flush when replacing huge zero PMD
"David Hildenbrand (Arm)" <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.mm |
|---|---|
| Message-ID | <[email protected]> |
On 8/17/26 18:39, Zi Yan wrote:
> On Mon Aug 17, 2026 at 2:08 AM EDT, Hui Su wrote:
>> migrate_vma_insert_huge_pmd_page() calls flush_cache_page() before
>> replacing an existing huge zero PMD. However, the third argument to
>> flush_cache_page() is a PFN, while addr + HPAGE_PMD_SIZE is an end
>> virtual address.
>>
>> More importantly, the mapping being invalidated is PMD-sized rather
>> than PAGE_SIZE-sized. Flush the whole PMD range with
>> flush_cache_range(), matching other huge PMD invalidation paths.
>>
>> Fixes: a30b48bf1b24 ("mm/migrate_device: implement THP migration of zone device pages")
>> Signed-off-by: Hui Su <[email protected]>
>> ---
>> mm/migrate_device.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>
> Thank you for fixing it.
>
> Reviewed-by: Zi Yan <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
I do wonder whether there should be a PMD helper.
--
Cheers,
David