LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
Cc: "osalvador@suse.de" <osalvador@suse.de>,
	"tdmackey@twitter.com" <tdmackey@twitter.com>,
	"david@redhat.com" <david@redhat.com>,
	"willy@infradead.org" <willy@infradead.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [v2 PATCH 3/3] mm: hwpoison: dump page for unhandlable page
Date: Fri, 20 Aug 2021 11:40:24 -0700	[thread overview]
Message-ID: <CAHbLzkqnBbqz7rHTQWsBKdq5uSdKDJX=iDz+HDyF2Jo6CX3H1g@mail.gmail.com> (raw)
In-Reply-To: <20210820064832.GA63355@hori.linux.bs1.fc.nec.co.jp>

On Thu, Aug 19, 2021 at 11:48 PM HORIGUCHI NAOYA(堀口 直也)
<naoya.horiguchi@nec.com> wrote:
>
> On Wed, Aug 18, 2021 at 10:41:16PM -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 <willy@infradead.org>
> > Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
> > Cc: Oscar Salvador <osalvador@suse.de>
> > Signed-off-by: Yang Shi <shy828301@gmail.com>
> > ---
> >  mm/memory-failure.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> > index 7cfa134b1370..60df8fcd0444 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");
> > +
>
> I feel that 4 callers of get_hwpoison_page() are in the different context,
> so it might be better to consider them separately to add dump_page() or not.
> soft_offline_page() still prints out "%s: %#lx: unknown page type: %lx (%pGp)"

No strong opinion to keep or remove it.

> message, which might be duplicate so this printk() may be dropped.
> In memory_failure_hugetlb() and memory_failure(), we can call dump_page() after
> action_result().  unpoison_memory() doesn't need dump_page() at all because
> it's related to already hwpoisoned page.

I don't have a strong opinion either to have the dump_page() called
either before action or after action, it just moves around the dumped
page information around that printk.

For unpoison_memory(), I think it is harmless to have dump_page()
called, right? If get_hwpoison_page() can't return -EIO, then the
dump_page() won't be called at all, if it is possible then this is
exactly why we call dump_page() to help debug.

So IMHO calling dump_page() in get_any_page when -EIO is returned
could work for all the cases well and avoid duplicating the call.

>
> Thanks,
> Naoya Horiguchi

  reply	other threads:[~2021-08-20 18:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  5:41 [v2 PATCH 1/3] mm: hwpoison: don't drop slab caches for offlining non-LRU page Yang Shi
2021-08-19  5:41 ` [v2 PATCH 2/3] doc: hwpoison: correct the support for hugepage Yang Shi
2021-08-20  9:34   ` David Hildenbrand
2021-08-19  5:41 ` [v2 PATCH 3/3] mm: hwpoison: dump page for unhandlable page Yang Shi
2021-08-20  6:48   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-20 18:40     ` Yang Shi [this message]
2021-08-23  5:05       ` HORIGUCHI NAOYA(堀口 直也)
2021-08-23 17:47         ` Yang Shi
2021-08-23 23:17           ` HORIGUCHI NAOYA(堀口 直也)
2021-09-22 19:37   ` Luck, Tony
2021-09-22 19:58     ` Yang Shi
2021-09-22 20:37       ` Yang Shi
2021-08-20  7:04 ` [v2 PATCH 1/3] mm: hwpoison: don't drop slab caches for offlining non-LRU page HORIGUCHI NAOYA(堀口 直也)
2021-08-20  7:08 ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHbLzkqnBbqz7rHTQWsBKdq5uSdKDJX=iDz+HDyF2Jo6CX3H1g@mail.gmail.com' \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=osalvador@suse.de \
    --cc=tdmackey@twitter.com \
    --cc=willy@infradead.org \
    --subject='Re: [v2 PATCH 3/3] mm: hwpoison: dump page for unhandlable page' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).