From patchwork Thu Sep 17 08:10:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 11781969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10171618 for ; Thu, 17 Sep 2020 08:28:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BEB9120770 for ; Thu, 17 Sep 2020 08:28:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEB9120770 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 016806B005D; Thu, 17 Sep 2020 04:28:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EE1256B0062; Thu, 17 Sep 2020 04:28:09 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD05F6B0068; Thu, 17 Sep 2020 04:28:09 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id C3C086B005D for ; Thu, 17 Sep 2020 04:28:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7FD618249980 for ; Thu, 17 Sep 2020 08:28:09 +0000 (UTC) X-FDA: 77271875898.29.eyes19_4906f0527121 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 63900180868EE for ; Thu, 17 Sep 2020 08:28:09 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,osalvador@suse.de,,RULES_HIT:30012:30054:30070,0,RBL:195.135.220.15:@suse.de:.lbl8.mailshell.net-64.100.201.201 62.2.6.2;04yrimipabzq5ca444adzxxxerr7ryceppofnf5ohqpp4p51e39cux9ywa3jnep.cf735d89fkekqtj5u1exkih3ysp3edtt4hkr9ykettdbdrsf56f6181f5bt9rc4.6-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: eyes19_4906f0527121 X-Filterd-Recvd-Size: 2163 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 08:28:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BAF28B146; Thu, 17 Sep 2020 08:28:40 +0000 (UTC) From: Oscar Salvador To: akpm@linux-foundation.org Cc: aris@ruivo.org, 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 Subject: [PATCH v4 7/7] mm,hwpoison: remove stale code Date: Thu, 17 Sep 2020 10:10:49 +0200 Message-Id: <20200917081049.27428-8-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20200917081049.27428-1-osalvador@suse.de> References: <20200917081049.27428-1-osalvador@suse.de> X-Rspamd-Queue-Id: 63900180868EE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- mm/memory-failure.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 7fba4ba201d5..f68cb5e3b320 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_FAILED : MF_RECOVERED); - else - action_result(pfn, MF_MSG_BUDDY_2ND, res ? MF_FAILED : MF_RECOVERED); - - return res; - } lock_page(p);