Re: [PATCH 0/6] use memcpy_mcsafe() for copy_to_iter()

From: Linus Torvalds
Date: Tue May 01 2018 - 23:13:48 EST


On Tue, May 1, 2018 at 8:03 PM Dan Williams <dan.j.williams@xxxxxxxxx>
wrote:

> Because dax. There's no page cache indirection games we can play here
> to poison a page and map in another page. The mapped page is 1:1
> associated with the filesystem block and physical memory address.

I'm not talking page cache indirection.

I'm talking literally mapping a different page into the kernel virtual
address space that the failing read was done for.

But you seem to be right that we don't actually support that. I'm guessing
the hwpoison code has never had to run in that kind of situation and will
just give up.

That would seem to be sad. It really feels like the obvious solution to any
MCE's - just map a dummy page at the address that causes problems.

That can have bad effects for real memory (because who knows what internal
kernel data structure might be in there), but would seem to be the
_optimal_ solution for some random pmem access. And makes it absolutely
trivial to just return to the execution that got the error exception.

Linus