RE: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned

Luck, Tony
2021-03-05T15:56:39Z

> From the walk, it seems we have got the virtual address, can we just send a SIGBUS with it?

If the walk wins the race and the pte for the poisoned page is still valid, then yes.

But we could have:

CPU1 CPU2
memory_failure sets poison
bit for struct page

rmap finds page in task
on CPU2 and sets PTE
to not-valid-poison

memory_failure returns
early because struct page
already marked as poison

walk page tables looking
for mapping - don't find it

-Tony