[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3908561D78D1C84285E8C5FCA982C28F612E4285@ORSMSX114.amr.corp.intel.com>
Date: Tue, 27 Jun 2017 22:04:58 +0000
From: "Luck, Tony" <tony.luck@...el.com>
To: "Elliott, Robert (Persistent Memory)" <elliott@....com>,
Borislav Petkov <bp@...e.de>
CC: "Hansen, Dave" <dave.hansen@...el.com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Yazen Ghannam <yazen.ghannam@....com>,
"Kani, Toshimitsu" <toshi.kani@....com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
Subject: RE: [PATCH] mm/hwpoison: Clear PRESENT bit for kernel 1:1 mappings
of poison pages
> > > > +if (set_memory_np(decoy_addr, 1))
> > > > +pr_warn("Could not invalidate pfn=0x%lx from 1:1 map \n",
>
> Another concept to consider is mapping the page as UC rather than
> completely unmapping it.
UC would also avoid the speculative prefetch issue. The Vol 3, Section 11.3 SDM says:
Strong Uncacheable (UC) -System memory locations are not cached. All reads and writes
appear on the system bus and are executed in program order without reordering. No speculative
memory accesses, pagetable walks, or prefetches of speculated branch targets are made.
This type of cache-control is useful for memory-mapped I/O devices. When used with normal
RAM, it greatly reduces processor performance.
But then I went and read the code for set_memory_uc() ... which calls "reserve_memtyep()"
which does all kinds of things to avoid issues with MTRRs and other stuff. Which all looks
really more complex that we need just here.
> The uncorrectable error scope could be smaller than a page size, like:
> * memory ECC width (e.g., 8 bytes)
> * cache line size (e.g., 64 bytes)
> * block device logical block size (e.g., 512 bytes, for persistent memory)
>
> UC preserves the ability to access adjacent data within the page that
> hasn't gone bad, and is particularly useful for persistent memory.
If you want to dig into the non-poisoned pieces of the page later it might be
better to set up a new scratch UC mapping to do that.
My takeaway from Dan's comments on unpoisoning is that this isn't the context
that he wants to do that. He'd rather wait until he has somebody overwriting the
page with fresh data.
So I think I'd like to keep the patch as-is.
-Tony
Powered by blists - more mailing lists