2021-08-24 02:12:19

by Yang Shi

[permalink] [raw]
Subject: [v3 PATCH 3/3] mm: hwpoison: dump page for unhandlable page

Currently just very simple message is shown for unhandlable page, e.g.
non-LRU page, like:
soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 ()

It is not very helpful for further debug, calling dump_page() could show
more useful information.

Calling dump_page() in get_any_page() in order to not duplicate the call
in a couple of different places. It may be called with pcp disabled and
holding memory hotplug lock, it should be not a big deal since hwpoison
handler is not called very often.

Suggested-by: Matthew Wilcox <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: Oscar Salvador <[email protected]>
Signed-off-by: Yang Shi <[email protected]>
---
v3: * Remove redundant pr_info per Noaya Horiguchi

mm/memory-failure.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 7cfa134b1370..5f8249e4d7dc 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1228,6 +1228,9 @@ static int get_any_page(struct page *p, unsigned long flags)
ret = -EIO;
}
out:
+ if (ret == -EIO)
+ dump_page(p, "hwpoison: unhandlable page");
+
return ret;
}

@@ -2205,9 +2208,6 @@ int soft_offline_page(unsigned long pfn, int flags)
try_again = false;
goto retry;
}
- } else if (ret == -EIO) {
- pr_info("%s: %#lx: unknown page type: %lx (%pGp)\n",
- __func__, pfn, page->flags, &page->flags);
}

return ret;
--
2.26.2


Subject: Re: [v3 PATCH 3/3] mm: hwpoison: dump page for unhandlable page

On Mon, Aug 23, 2021 at 07:09:46PM -0700, Yang Shi wrote:
> Currently just very simple message is shown for unhandlable page, e.g.
> non-LRU page, like:
> soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 ()
>
> It is not very helpful for further debug, calling dump_page() could show
> more useful information.
>
> Calling dump_page() in get_any_page() in order to not duplicate the call
> in a couple of different places. It may be called with pcp disabled and
> holding memory hotplug lock, it should be not a big deal since hwpoison
> handler is not called very often.
>
> Suggested-by: Matthew Wilcox <[email protected]>
> Cc: Naoya Horiguchi <[email protected]>
> Cc: Oscar Salvador <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>

Acked-by: Naoya Horiguchi <[email protected]>

Thank you.

2021-08-25 08:18:38

by David Hildenbrand

[permalink] [raw]
Subject: Re: [v3 PATCH 3/3] mm: hwpoison: dump page for unhandlable page

On 24.08.21 04:09, Yang Shi wrote:
> Currently just very simple message is shown for unhandlable page, e.g.
> non-LRU page, like:
> soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 ()
>
> It is not very helpful for further debug, calling dump_page() could show
> more useful information.
>
> Calling dump_page() in get_any_page() in order to not duplicate the call
> in a couple of different places. It may be called with pcp disabled and
> holding memory hotplug lock, it should be not a big deal since hwpoison
> handler is not called very often.
>
> Suggested-by: Matthew Wilcox <[email protected]>
> Cc: Naoya Horiguchi <[email protected]>
> Cc: Oscar Salvador <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>
> ---
> v3: * Remove redundant pr_info per Noaya Horiguchi
>
> mm/memory-failure.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 7cfa134b1370..5f8249e4d7dc 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1228,6 +1228,9 @@ static int get_any_page(struct page *p, unsigned long flags)
> ret = -EIO;
> }
> out:
> + if (ret == -EIO)
> + dump_page(p, "hwpoison: unhandlable page");
> +
> return ret;
> }
>
> @@ -2205,9 +2208,6 @@ int soft_offline_page(unsigned long pfn, int flags)
> try_again = false;
> goto retry;
> }
> - } else if (ret == -EIO) {
> - pr_info("%s: %#lx: unknown page type: %lx (%pGp)\n",
> - __func__, pfn, page->flags, &page->flags);
> }
>
> return ret;
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb