Re: [RFC PATCH v2 10/16] mm,hwpoison: Rework soft offline for free pages

From: Michal Hocko
Date: Tue Oct 22 2019 - 05:23:00 EST


On Tue 22-10-19 10:35:17, Oscar Salvador wrote:
> On Tue, Oct 22, 2019 at 10:26:11AM +0200, Michal Hocko wrote:
> > On Tue 22-10-19 09:46:20, Oscar Salvador wrote:
> > [...]
> > > So, opposite to hard-offline, in soft-offline we do not fiddle with pages
> > > unless we are sure the page is not reachable anymore by any means.
> >
> > I have to say I do not follow. Is there any _real_ reason for
> > soft-offline to behave differenttly from MCE (hard-offline)?
>
> Yes.
> Do not take it as 100% true as I read that in some code/Documentation
> a while ago.
>
> But I think that it boils down to:
>
> soft-offline: "We have seen some erros in the underlying page, but
> it is still usable, so we have a chance to keep the
> the contents (via migration)"
> hard-offline: "The underlying page is dead, we cannot trust it, so
> we shut it down, killing whoever is holding it
> along the way".

Hmm, that might be a misunderstanding on my end. I thought that it is
the MCE handler to say whether the failure is recoverable or not. If yes
then we can touch the content of the memory (that would imply the
migration). Other than that both paths should be essentially the same,
no? Well unrecoverable case would be essentially force migration failure
path.

MADV_HWPOISON is explicitly documented to test MCE handling IIUC:
: This feature is intended for testing of memory error-handling
: code; it is available only if the kernel was configured with
: CONFIG_MEMORY_FAILURE.

There is no explicit note about the type of the error that is injected
but I think it is reasonably safe to assume this is a recoverable one.
--
Michal Hocko
SUSE Labs