We have faced a different race here as follow: CPU#0 cpu #1 offline_pages do_migrate_range memory_failure TestSetPageHWPoison // folio is mark poison here unmap_poisoned_folio // should kill task here ... hwpoison_user_mappings
Interesting; TestSetPageHWPoison is called before we grab the folio lock, so even grabbing that around unmap_poisoned_folio() cannot completely help.
-- Cheers, David / dhildenb