Re: [PATCH 08/13] mm/migrate_device: fix ksmd oops on a migrated KSM page
From: Gregory Price (Meta)
Date: Thu Nov 12 2026 - 12:29:12 EST
On 2026-11-11 18:13 +0000, Lorenzo Stoakes (ARM) wrote:
> From: Chris Mason <mason@xxxxxxxxxx>
>
> After a KSM page is migrated to device private memory, ksmd can oops,
> and KSM then stops until reboot. A process that maps the page can also
> loop in page faults when it next accesses the page.
>
> The problem arises because KSM doesn't know not to try to look at device
> private memory that does not exist in the direct map.
>
> Disallow this from happening by explicitly testing for this scenario in
> __migrate_device_pages().
>
> Fixes: a5430dda8a3a ("mm/migrate: support un-addressable ZONE_DEVICE page in migration")
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Chris Mason <mason@xxxxxxxxxx>
> [ ljs: tweak commit message, comment ]
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
Reproduced and tested the fix. I validated in the base kernel that
a migration could succeed and after this patch it cannot.
Tested-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
--
~Gregory