Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2043131pxk; Mon, 14 Sep 2020 03:18:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8sC8AEWQssQf27lWA73u/DI80t2offpqIkLGKa3mTUEtYE5n8P2YvhnCI0k6n4w9zU1jP X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr17025776edt.78.1600078722602; Mon, 14 Sep 2020 03:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600078722; cv=none; d=google.com; s=arc-20160816; b=cSqhxAYj+J+OY2A+MM4hOtEjpSOHxPm9a93ejeQXdj9gbbXcpYplBj1WdC9aYBMPji 693XQWQxd0xfPJjWW7F/apemL3mYa3PS2zYgYlh81crJBrp9YfCSxLVJOulzPPvQVeWC ezKWIxES7aG26k74ose4Z2NwvVgo3YbQXvgdF5jdwtalgE4fydI6r8kHqLwq7utemU4K NhVhQPX9iHRUHAPg3bCykQf9W0DdEsBixrbrpedQ6+Cn/AT3IS9sfAz4fCheR3OQzslc VOfEo5wgCYaPNgZHek3nrwLCW3pU5JPZuwieMipqu67d/NRKMjg5QzBaRSq42uPVnjsP Vn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=CEH0JfK7iCg+L8xKzPnIMQp9O5k29XoBO1hDKiNwLUA=; b=wQUybQ8JJ6C6tRBP1qRqIvUvMhNjTfSssdUnqkvy7U5115o+6YcEZRYy8CdD6ez8bV ABwTdCJZVqNSWlTq/f3u1oswl3ZzkPA9sWqkXDEt18CCDuRrJspXq3HkleWnMslslRYx pj+9aq8ApBZXWf4XfMK73WC1rw4CbUAsCHDWdYOB+Ytj8lefFQxtUKzEY8lIAYtZwpIx XQtevs86DJ1Nbi2mc/PlLYBoCSQcmVfZhHsUah1bX/7DVL/QvOQk+rMNJpzwCv3ap/Qt u8kmNf6T5cJsYA/3Z+PqTXYafkOvMC1XWLx5wP7E8PwSrpkN/kWxTABUC5586RfZnQHA BKsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si7032415edr.266.2020.09.14.03.18.20; Mon, 14 Sep 2020 03:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbgINKQj (ORCPT + 99 others); Mon, 14 Sep 2020 06:16:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:44850 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbgINKQH (ORCPT ); Mon, 14 Sep 2020 06:16:07 -0400 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 9869AB080; Mon, 14 Sep 2020 10:16:21 +0000 (UTC) From: Oscar Salvador 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 , Oscar Salvador , Stephen Rothwell Subject: [PATCH v3 5/5] mm,hwpoison: remove stale code Date: Mon, 14 Sep 2020 12:15:59 +0200 Message-Id: <20200914101559.17103-6-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20200914101559.17103-1-osalvador@suse.de> References: <20200914101559.17103-1-osalvador@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Link: https://lkml.kernel.org/r/20200908075626.11976-6-osalvador@suse.de Signed-off-by: Oscar Salvador Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Qian Cai Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell --- mm/memory-failure.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4468c1eb5027..fbe174d54fad 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1421,18 +1421,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); -- 2.26.2