linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Hubbard <jhubbard@nvidia.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	William Kucharski <william.kucharski@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mm/hwpoison: use pr_err() instead of dump_page() in get_any_page()
Date: Tue, 10 May 2022 10:31:58 +0000	[thread overview]
Message-ID: <20220510103158.GA174652@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <YnnNteG8+V6dTNna@casper.infradead.org>

On Tue, May 10, 2022 at 03:28:05AM +0100, Matthew Wilcox wrote:
> On Wed, Apr 27, 2022 at 02:32:20PM +0900, Naoya Horiguchi wrote:
> > From: Naoya Horiguchi <naoya.horiguchi@nec.com>
> > 
> > The following VM_BUG_ON_FOLIO() is triggered when memory error event
> > happens on the (thp/folio) pages which are about to be freed:
> 
> So the real problem is that we're calling dump_page() when we don't
> have a reference to the page, right?  Otherwise it wouldn't be freed.

Right, that's the problem.

> 
> >  out:
> >  	if (ret == -EIO)
> > -		dump_page(p, "hwpoison: unhandlable page");
> > +		pr_err("Memory failure: %#lx: unhandlable page.\n", page_to_pfn(p));
> 
> It would be nice to get some more information out of the page than that
> ,.. but taking a refcount inside dump_page() conflicts with the other
> "would be nice", which is for dump_page() to take a const struct page *
> so we can (eg) make folio_test_uptodate() take a const struct folio *.
> 
> We've had some other problems with inconsistent pages being printed in
> dump_page().  It can be quite confusing when debugging.  I still don't
> have a good solution to that either.
> 
> I do have a proposal for reforming mapcount which will solve this
> particular problem, but I'm not quite sure when I'll get to it.
> This patch is probably the best thing to do for now.

Thank you for the comment.  So I leave this code simple (or some
hwpoison specific dump_page() if someone have good ideas) until some
ultimate solution is ready for upstream.

Thanks,
Naoya Horiguchi

      reply	other threads:[~2022-05-10 10:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  5:32 Naoya Horiguchi
2022-04-27 19:15 ` Andrew Morton
2022-04-27 22:37   ` HORIGUCHI NAOYA(堀口 直也)
2022-04-27 23:48 ` John Hubbard
2022-04-28  1:46 ` Miaohe Lin
2022-04-28 17:25 ` Yang Shi
2022-05-09  7:14   ` ##freemail## " HORIGUCHI NAOYA(堀口 直也)
2022-05-10  0:16     ` Yang Shi
2022-05-10  2:28 ` Matthew Wilcox
2022-05-10 10:31   ` HORIGUCHI NAOYA(堀口 直也) [this message]

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=20220510103158.GA174652@hori.linux.bs1.fc.nec.co.jp \
    --to=naoya.horiguchi@nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@linux.dev \
    --cc=william.kucharski@oracle.com \
    --cc=willy@infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox