mirror of https://gitee.com/openkylin/linux.git
HWPOISON: Add page flag for poisoned pages
Hardware poisoned pages need special handling in the VM and shouldn't be touched again. This requires a new page flag. Define it here. The page flags wars seem to be over, so it shouldn't be a problem to get a new one. v2: Add TestSetHWPoison (suggested by Johannes Weiner) Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
This commit is contained in:
parent
0cb583fd28
commit
d466f2fcb3
|
@ -51,6 +51,9 @@
|
||||||
* PG_buddy is set to indicate that the page is free and in the buddy system
|
* PG_buddy is set to indicate that the page is free and in the buddy system
|
||||||
* (see mm/page_alloc.c).
|
* (see mm/page_alloc.c).
|
||||||
*
|
*
|
||||||
|
* PG_hwpoison indicates that a page got corrupted in hardware and contains
|
||||||
|
* data with incorrect ECC bits that triggered a machine check. Accessing is
|
||||||
|
* not safe since it may cause another machine check. Don't touch!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -101,6 +104,9 @@ enum pageflags {
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ARCH_USES_PG_UNCACHED
|
#ifdef CONFIG_ARCH_USES_PG_UNCACHED
|
||||||
PG_uncached, /* Page has been mapped as uncached */
|
PG_uncached, /* Page has been mapped as uncached */
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MEMORY_FAILURE
|
||||||
|
PG_hwpoison, /* hardware poisoned page. Don't touch */
|
||||||
#endif
|
#endif
|
||||||
__NR_PAGEFLAGS,
|
__NR_PAGEFLAGS,
|
||||||
|
|
||||||
|
@ -263,6 +269,15 @@ PAGEFLAG(Uncached, uncached)
|
||||||
PAGEFLAG_FALSE(Uncached)
|
PAGEFLAG_FALSE(Uncached)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_MEMORY_FAILURE
|
||||||
|
PAGEFLAG(HWPoison, hwpoison)
|
||||||
|
TESTSETFLAG(HWPoison, hwpoison)
|
||||||
|
#define __PG_HWPOISON (1UL << PG_hwpoison)
|
||||||
|
#else
|
||||||
|
PAGEFLAG_FALSE(HWPoison)
|
||||||
|
#define __PG_HWPOISON 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline int PageUptodate(struct page *page)
|
static inline int PageUptodate(struct page *page)
|
||||||
{
|
{
|
||||||
int ret = test_bit(PG_uptodate, &(page)->flags);
|
int ret = test_bit(PG_uptodate, &(page)->flags);
|
||||||
|
@ -387,7 +402,7 @@ static inline void __ClearPageTail(struct page *page)
|
||||||
1 << PG_private | 1 << PG_private_2 | \
|
1 << PG_private | 1 << PG_private_2 | \
|
||||||
1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \
|
1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \
|
||||||
1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \
|
1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \
|
||||||
1 << PG_unevictable | __PG_MLOCKED)
|
1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flags checked when a page is prepped for return by the page allocator.
|
* Flags checked when a page is prepped for return by the page allocator.
|
||||||
|
|
Loading…
Reference in New Issue