diff options
| author | Naoya Horiguchi <[email protected]> | 2022-10-24 06:20:12 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2022-11-09 01:37:22 +0000 |
| commit | 5033091de814ab4b5623faed2755f3064e19e2d2 (patch) | |
| tree | 7edde57024f06ca1015a0cc59e0173d848d04ade /mm/internal.h | |
| parent | mm/hwpoison: pass pfn to num_poisoned_pages_*() (diff) | |
| download | kernel-5033091de814ab4b5623faed2755f3064e19e2d2.tar.gz kernel-5033091de814ab4b5623faed2755f3064e19e2d2.zip | |
mm/hwpoison: introduce per-memory_block hwpoison counter
Currently PageHWPoison flag does not behave well when experiencing memory
hotremove/hotplug. Any data field in struct page is unreliable when the
associated memory is offlined, and the current mechanism can't tell
whether a memory block is onlined because a new memory devices is
installed or because previous failed offline operations are undone.
Especially if there's a hwpoisoned memory, it's unclear what the best
option is.
So introduce a new mechanism to make struct memory_block remember that a
memory block has hwpoisoned memory inside it. And make any online event
fail if the onlining memory block contains hwpoison. struct memory_block
is freed and reallocated over ACPI-based hotremove/hotplug, but not over
sysfs-based hotremove/hotplug. So the new counter can distinguish these
cases.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Naoya Horiguchi <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Miaohe Lin <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Jane Chu <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Yang Shi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/internal.h')
| -rw-r--r-- | mm/internal.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/mm/internal.h b/mm/internal.h index 68afdbe7106e..bcf75a8b032d 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -708,14 +708,6 @@ extern u64 hwpoison_filter_flags_value; extern u64 hwpoison_filter_memcg; extern u32 hwpoison_filter_enable; -#ifdef CONFIG_MEMORY_FAILURE -void clear_hwpoisoned_pages(struct page *memmap, int nr_pages); -#else -static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) -{ -} -#endif - extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); |
