All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Oscar Salvador <osalvador@suse.de>,
	Michal Hocko <mhocko@suse.com>, Tony Luck <tony.luck@intel.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mm/hwpoison: do not lock page again when me_huge_page() successfully recovers
Date: Thu, 10 Jun 2021 16:50:59 -0700	[thread overview]
Message-ID: <20210610165059.6618498250f60674c1bb9c03@linux-foundation.org> (raw)
In-Reply-To: <20210609072029.74645-1-nao.horiguchi@gmail.com>

On Wed,  9 Jun 2021 16:20:29 +0900 Naoya Horiguchi <nao.horiguchi@gmail.com> wrote:

> Currently me_huge_page() temporary unlocks page to perform some actions
> then locks it again later.  My testcase (which calls hard-offline on
> some tail page in a hugetlb, then accesses the address of the hugetlb
> range) showed that page allocation code detects this page lock on buddy
> page and printed out "BUG: Bad page state" message.
> 
> check_new_page_bad() does not consider a page with __PG_HWPOISON as bad
> page, so this flag works as kind of filter, but this filtering doesn't
> work in this case because the "bad page" is not the actual hwpoisoned
> page. So stop locking page again.  Actions to be taken depend on the
> page type of the error, so page unlocking should be done in ->action()
> callbacks.  So let's make it assumed and change all existing callbacks
> that way.

I'm getting a reject against Linus mainline here, and a -stable patch
doesn't want such things happening.

--- mm/memory-failure.c
+++ mm/memory-failure.c
@@ -1782,6 +1796,8 @@ int memory_failure(unsigned long pfn, int flags)
 
 identify_page_state:
 	res = identify_page_state(pfn, p, page_flags);
+	mutex_unlock(&mf_mutex);
+	return res;
 unlock_page:
 	unlock_page(p);
 unlock_mutex:

and...  That mutex_unlock() looks odd.  The patch adds no matching
mutex_lock?

  reply	other threads:[~2021-06-10 23:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  7:20 [PATCH v3] mm/hwpoison: do not lock page again when me_huge_page() successfully recovers Naoya Horiguchi
2021-06-10 23:50 ` Andrew Morton [this message]
     [not found]   ` <20210611002329.GA1201351@hori.linux.bs1.fc.nec.co.jp>
2021-06-15  2:35     ` Andrew Morton
2021-06-15  3:58       ` HORIGUCHI NAOYA(堀口 直也)
2021-06-15 23:48         ` Andrew Morton

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=20210610165059.6618498250f60674c1bb9c03@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=nao.horiguchi@gmail.com \
    --cc=naoya.horiguchi@nec.com \
    --cc=osalvador@suse.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.