All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: akpm@linux-foundation.org
Cc: naoya.horiguchi@nec.com, mhocko@kernel.org, tony.luck@intel.com,
	cai@lca.pw, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Oscar Salvador <osalvador@suse.de>
Subject: [PATCH v2 5/5] mm,hwpoison: Remove stale code
Date: Tue,  8 Sep 2020 09:56:26 +0200	[thread overview]
Message-ID: <20200908075626.11976-6-osalvador@suse.de> (raw)
In-Reply-To: <20200908075626.11976-1-osalvador@suse.de>

Currently we call shake_page and then check whether the page is
Buddy because shake_page calls drain_all_pages, which sends pcp-pages
back to the buddy freelists, so we could have a chance to handle
free pages.

get_hwpoison_page already calls drain_all_pages, and we do call
get_hwpoison_page right before coming here, so we should be on
the safe side.

Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
 mm/memory-failure.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index e57fc5c5117a..eb72360bd78b 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1423,18 +1423,6 @@ int memory_failure(unsigned long pfn, int flags)
 	 * walked by the page reclaim code, however that's not a big loss.
 	 */
 	shake_page(p, 0);
-	/* shake_page could have turned it free. */
-	if (!PageLRU(p) && is_free_buddy_page(p)) {
-		if (!take_page_off_buddy(p))
-			res = -EBUSY;
-
-		if (flags & MF_COUNT_INCREASED)
-			action_result(pfn, MF_MSG_BUDDY, res ? MF_IGNORED : MF_RECOVERED);
-		else
-			action_result(pfn, MF_MSG_BUDDY_2ND, res ? MF_IGNORED : MF_RECOVERED);
-
-		return res;
-	}
 
 	lock_page(p);
 
-- 
2.26.2


  parent reply	other threads:[~2020-09-08  7:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  7:56 [PATCH v2 0/5] HWpoison: further fixes and cleanups Oscar Salvador
2020-09-08  7:56 ` [PATCH v2 1/5] mm,hwpoison: Take free pages off the buddy freelists Oscar Salvador
2020-09-11  2:37   ` HORIGUCHI NAOYA(堀口 直也)
2020-09-08  7:56 ` [PATCH v2 2/5] mm,hwpoison: Refactor madvise_inject_error Oscar Salvador
2020-09-08  7:56 ` [PATCH v2 3/5] mm,hwpoison: Drain pcplists before bailing out for non-buddy zero-refcount page Oscar Salvador
2020-09-08  7:56 ` [PATCH v2 4/5] mm,hwpoison: Drop unneeded pcplist draining Oscar Salvador
2020-09-08  7:56 ` Oscar Salvador [this message]
2020-09-10 20:07 ` [PATCH v2 0/5] HWpoison: further fixes and cleanups osalvador

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=20200908075626.11976-6-osalvador@suse.de \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=tony.luck@intel.com \
    /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.