On Thu, Sep 30, 2021 at 01:39:03PM -0700, Dan Williams wrote:
> Yes, that's a good way to think about it. The only way to avoid poison
> for page allocator pages is to just ditch the page. In the case of
> PMEM the driver can do this fine grained dance because it gets precise
> sub-page poison lists to consult and implements a non-mmap path to
> access the page contents.
Ok, good.
Now, before we do anything further here, I'd like for this very much
non-obvious situation to be documented in detail so that we know what's
going on there and what that whole_page notion even means. Because this
is at least bending the meaning of page states like poison and what that
really means for the underlying thing - PMEM or general purpose DIMMs.
And then that test could be something like:
/*
* Normal DRAM gets poisoned as a whole page, yadda yadda...
/
if (whole_page) {
/*
* Special handling for PMEM case, driver can handle accessing sub-page
ranges
* even if the whole "page" is poisoned, blabla
} else {
rc = _set_memory_uc(decoy_addr, 1);
...
so that it is crystal clear what's going on there.
Thx!
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette