From patchwork Tue May 11 15:10:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12251335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 226C9C433ED for ; Tue, 11 May 2021 15:10:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B637A61396 for ; Tue, 11 May 2021 15:10:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B637A61396 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3F9E36B0072; Tue, 11 May 2021 11:10:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D0A76B0074; Tue, 11 May 2021 11:10:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24B796B0075; Tue, 11 May 2021 11:10:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 059826B0072 for ; Tue, 11 May 2021 11:10:36 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A0AAF8249980 for ; Tue, 11 May 2021 15:10:35 +0000 (UTC) X-FDA: 78129286830.09.F77849B Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf09.hostedemail.com (Postfix) with ESMTP id 14F5160006EB for ; Tue, 11 May 2021 15:10:23 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id i14so15976902pgk.5 for ; Tue, 11 May 2021 08:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UbtTKJ2DcWa23Eh4eF2HPJAjR+99XcZMmH1/neJWDQ8=; b=QTNSiMVFnSywFux8M9OXGZ5EQbqceGuac6FMw6rHlU9KjCFrPf0bHZ3Xr0Z04QlKTy sA3ePnvTS+Vx7qR1qZJ+iQMmxOHMiVY1GR1ZVI0GaB3Zc4qr5IXji+4iwWdg6he7JAqt FCa4lVCA9NPPBs5p7xl7LkW9z1TEfROS9Y/ncwasROYr1+luDNmk2XRfXCdU8tJFzPkY CeVS0n3O50AYYAyD9IW14nc0ZvKxpr0/GwJaat5dWo87ur9SBELo0k6Ox18m280o3Nnt xuZ0h9OUGtUmYOhT1Dge2BV/rSH1VdPdZIlmzvw0MikdDNsPZTqL0nGamvETt+gSXQUq XBdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UbtTKJ2DcWa23Eh4eF2HPJAjR+99XcZMmH1/neJWDQ8=; b=RpY0tTCV0p2/+pADPy9L6De8vo0N7HDGyY3PirxG3y7qvt+bQzZneJ7BKubYt+QuqT iAk5DDIGEE6nJdm/GGIvvC8HQUvM34kdHRhAXAsnAYUJ0wkpZYr5KkFFqOAYDIhFODyE tkIRLsE5MjBa20qEy9cYGGuxhTQnv3JTyH+Uh/+nFG/vFxH1tCs5aiyORKehvQj0wSpT dCldTdR51tHUylY7PUB9vJj+KeXrCGRhRBBUf7OhQ4fOVc6tc9o/Rib+va3tlj/SwEde 1zth15Gp3GVEiOELsaartI8pfO3FvwESqYgaHLDqes0ebnZ1kZZKjqgD+TkpjNT4t+jG kcxQ== X-Gm-Message-State: AOAM531GkPNpvDyCBJsFAxtffE4B6UfPDSp754z6ICijoi3o1vUP7mvC vGtyMvoYNq8ni5niq/uE2A== X-Google-Smtp-Source: ABdhPJyBocarp5TadCgoUJ4Mj42j/CEn57OApWlVWJIzIHWBYeuT8aU50JM0Z099WD8uJmDWdomLxQ== X-Received: by 2002:a63:575b:: with SMTP id h27mr31948674pgm.180.1620745834264; Tue, 11 May 2021 08:10:34 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id a18sm14376456pgg.51.2021.05.11.08.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 08:10:34 -0700 (PDT) From: Naoya Horiguchi To: Oscar Salvador , Muchun Song , linux-mm@kvack.org Cc: Andrew Morton , Mike Kravetz , Michal Hocko , Tony Luck , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] mm,hwpoison: fix race with compound page allocation Date: Wed, 12 May 2021 00:10:15 +0900 Message-Id: <20210511151016.2310627-2-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511151016.2310627-1-nao.horiguchi@gmail.com> References: <20210511151016.2310627-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 14F5160006EB Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QTNSiMVF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.215.177 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-Rspamd-Server: rspam03 X-Stat-Signature: nzuz4umbicjf5ei6jx4ahctgkdng1u1n Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mail-pg1-f177.google.com; client-ip=209.85.215.177 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620745823-804167 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: From: Naoya Horiguchi When hugetlb page fault (under overcommiting situation) and memory_failure() race, VM_BUG_ON_PAGE() is triggered by the following race: CPU0: CPU1: gather_surplus_pages() page = alloc_surplus_huge_page() memory_failure_hugetlb() get_hwpoison_page(page) __get_hwpoison_page(page) get_page_unless_zero(page) zero = put_page_testzero(page) VM_BUG_ON_PAGE(!zero, page) enqueue_huge_page(h, page) put_page(page) __get_hwpoison_page() only checks page refcount before taking additional one for memory error handling, which is wrong because there's time windows where compound pages have non-zero refcount during initialization. So makes __get_hwpoison_page() check page status a bit more for a few types of compound pages. PageSlab() check is added because otherwise "non anonymous thp" path is wrongly chosen. Fixes: ead07f6a867b ("mm/memory-failure: introduce get_hwpoison_page() for consistent refcount handling") Signed-off-by: Naoya Horiguchi Reported-by: Muchun Song Cc: stable@vger.kernel.org # 5.12+ --- changelog v3: - recheck PageHuge after holding hugetlb_lock, --- mm/memory-failure.c | 55 ++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git v5.12/mm/memory-failure.c v5.12_patched/mm/memory-failure.c index a3659619d293..02668b24e512 100644 --- v5.12/mm/memory-failure.c +++ v5.12_patched/mm/memory-failure.c @@ -1095,30 +1095,43 @@ static int __get_hwpoison_page(struct page *page) { struct page *head = compound_head(page); - if (!PageHuge(head) && PageTransHuge(head)) { - /* - * Non anonymous thp exists only in allocation/free time. We - * can't handle such a case correctly, so let's give it up. - * This should be better than triggering BUG_ON when kernel - * tries to touch the "partially handled" page. - */ - if (!PageAnon(head)) { - pr_err("Memory failure: %#lx: non anonymous thp\n", - page_to_pfn(page)); - return 0; + if (PageCompound(page)) { + if (PageSlab(page)) { + return get_page_unless_zero(page); + } else if (PageHuge(head)) { + int ret = 0; + + spin_lock(&hugetlb_lock); + if (!PageHuge(head)) + ret = -EBUSY; + else if (HPageFreed(head) || HPageMigratable(head)) + ret = get_page_unless_zero(head); + spin_unlock(&hugetlb_lock); + return ret; + } else if (PageTransHuge(head)) { + /* + * Non anonymous thp exists only in allocation/free time. We + * can't handle such a case correctly, so let's give it up. + * This should be better than triggering BUG_ON when kernel + * tries to touch the "partially handled" page. + */ + if (!PageAnon(head)) { + pr_err("Memory failure: %#lx: non anonymous thp\n", + page_to_pfn(page)); + return 0; + } + if (get_page_unless_zero(head)) { + if (head == compound_head(page)) + return 1; + pr_info("Memory failure: %#lx cannot catch tail\n", + page_to_pfn(page)); + put_page(head); + } } + return 0; } - if (get_page_unless_zero(head)) { - if (head == compound_head(page)) - return 1; - - pr_info("Memory failure: %#lx cannot catch tail\n", - page_to_pfn(page)); - put_page(head); - } - - return 0; + return get_page_unless_zero(page); } /* From patchwork Tue May 11 15:10:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12251337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B27E3C43460 for ; Tue, 11 May 2021 15:10:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C7C5613CD for ; Tue, 11 May 2021 15:10:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C7C5613CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AFF6C6B0074; Tue, 11 May 2021 11:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AAE6F6B0075; Tue, 11 May 2021 11:10:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 928DE6B0078; Tue, 11 May 2021 11:10:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 773596B0074 for ; Tue, 11 May 2021 11:10:38 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 25936824999B for ; Tue, 11 May 2021 15:10:38 +0000 (UTC) X-FDA: 78129286956.24.A87CF82 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf28.hostedemail.com (Postfix) with ESMTP id 79CDB200027E for ; Tue, 11 May 2021 15:10:36 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id c21so15970586pgg.3 for ; Tue, 11 May 2021 08:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OZ5d92tbMpv53CASAYfzjoqnq/aMVSi1l8lFeEO33kw=; b=S47uKjFjUurhXRL03fjk/+x19BNkdGP1H3K3f3doqv7bnP4mRDlTeSY8/SdTK4STys yepDTUeK8GJfSiWgPnOvljZCzNmLlBeJU24y5lxHcksIyHOcQnYCeDoEtTrVbqMJmceR IbO5FcJ+0B0MD1zJ4Wgmhurf1e8vO0ADOpsVFxks7uWfwBMKb4VP2/iUkHBIQeGZYPJ7 tBGbUDfI82UM5VZvoMhHfH0jaWCPXI+yyiBht3gfzmryRgt0vFmfByT/xL6ATMAKMlhG Qo9pM7oIY39nW7O2ZX8qm23ejpxENY27C/ybw1FpdNyP+MOFdjMR/PC63cut1PZ2QXfi gdqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OZ5d92tbMpv53CASAYfzjoqnq/aMVSi1l8lFeEO33kw=; b=TB59bOIneQdZDSdvuVKh5kSc1UWV7nf1nFwwloncSnvF8Z8moa9oQXrwTXSJZSiZR2 pEJSx4lybPKirBK41crbUBQ/WtwyAuLNt+eeu4Mq2Sc91RXcpi5V/GiwdEZWZutNs5u0 AbJu1cAcvC6olPvMhz3z5iafkzcCUHrlHLHQzlDfBe/42yra9gotgrpF4cXcn8gurVzY 2IcQ0jgmCqKF6nogWj+1YxXbVbPL6+ewR6azUXjejojD+Kq9zF3ubkwlBS06Ad3o69r9 JXJ+LgClwmoBC1cSfu3mwBqF3C92JpTN6lx+lIIDQXbYOJlg4TyPg+pZc90DQZZU8Jte Ubdg== X-Gm-Message-State: AOAM531sPllIolGXCYWAQUnDUQi1YBchn7OOThogWKLJalfiq+6zQDjM Hjs4Ykh3cyCpewhBAJDCBQ== X-Google-Smtp-Source: ABdhPJzx8cS8/SccG8DadKbAZW3b71yMzOkwhASg4Srt6i9+n/n2OG/wTmNaDc5hbLI/JAz7in4ftw== X-Received: by 2002:a63:5d65:: with SMTP id o37mr30533198pgm.300.1620745836847; Tue, 11 May 2021 08:10:36 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id a18sm14376456pgg.51.2021.05.11.08.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 08:10:36 -0700 (PDT) From: Naoya Horiguchi To: Oscar Salvador , Muchun Song , linux-mm@kvack.org Cc: Andrew Morton , Mike Kravetz , Michal Hocko , Tony Luck , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] mm,hwpoison: make get_hwpoison_page call get_any_page() Date: Wed, 12 May 2021 00:10:16 +0900 Message-Id: <20210511151016.2310627-3-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511151016.2310627-1-nao.horiguchi@gmail.com> References: <20210511151016.2310627-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=S47uKjFj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-Stat-Signature: u6je8e5j863eoisew8hkoyekhraqemck X-Rspamd-Queue-Id: 79CDB200027E X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mail-pg1-f179.google.com; client-ip=209.85.215.179 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620745836-350409 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: From: Naoya Horiguchi Now __get_hwpoison_page() could return -EBUSY in a race condition, so it's helpful to handle it by retrying. We already have retry logic, so make get_hwpoison_page() call get_any_page() when called from memory_failure(). Signed-off-by: Naoya Horiguchi --- mm/memory-failure.c | 114 ++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git v5.12/mm/memory-failure.c v5.12_patched/mm/memory-failure.c index 02668b24e512..d6f470e9ee05 100644 --- v5.12/mm/memory-failure.c +++ v5.12_patched/mm/memory-failure.c @@ -1084,13 +1084,6 @@ static int page_action(struct page_state *ps, struct page *p, return (result == MF_RECOVERED || result == MF_DELAYED) ? 0 : -EBUSY; } -/** - * __get_hwpoison_page() - Get refcount for memory error handling: - * @page: raw error page (hit by memory error) - * - * Return: return 0 if failed to grab the refcount, otherwise true (some - * non-zero value.) - */ static int __get_hwpoison_page(struct page *page) { struct page *head = compound_head(page); @@ -1134,15 +1127,6 @@ static int __get_hwpoison_page(struct page *page) return get_page_unless_zero(page); } -/* - * Safely get reference count of an arbitrary page. - * - * Returns 0 for a free page, 1 for an in-use page, - * -EIO for a page-type we cannot handle and -EBUSY if we raced with an - * allocation. - * We only incremented refcount in case the page was already in-use and it - * is a known type we can handle. - */ static int get_any_page(struct page *p, unsigned long flags) { int ret = 0, pass = 0; @@ -1152,50 +1136,76 @@ static int get_any_page(struct page *p, unsigned long flags) count_increased = true; try_again: - if (!count_increased && !__get_hwpoison_page(p)) { - if (page_count(p)) { - /* We raced with an allocation, retry. */ - if (pass++ < 3) - goto try_again; - ret = -EBUSY; - } else if (!PageHuge(p) && !is_free_buddy_page(p)) { - /* We raced with put_page, retry. */ - if (pass++ < 3) - goto try_again; - ret = -EIO; + if (!count_increased) { + ret = __get_hwpoison_page(p); + if (!ret) { + if (page_count(p)) { + /* We raced with an allocation, retry. */ + if (pass++ < 3) + goto try_again; + ret = -EBUSY; + } else if (!PageHuge(p) && !is_free_buddy_page(p)) { + /* We raced with put_page, retry. */ + if (pass++ < 3) + goto try_again; + ret = -EIO; + } + goto out; } + } + + if (ret == -EBUSY) { + /* We raced with freeing huge page to buddy, retry. */ + if (pass++ < 3) + goto try_again; + } else if (PageHuge(p) || PageLRU(p) || __PageMovable(p)) { + ret = 1; } else { - if (PageHuge(p) || PageLRU(p) || __PageMovable(p)) { - ret = 1; - } else { - /* - * A page we cannot handle. Check whether we can turn - * it into something we can handle. - */ - if (pass++ < 3) { - put_page(p); - shake_page(p, 1); - count_increased = false; - goto try_again; - } + /* + * A page we cannot handle. Check whether we can turn + * it into something we can handle. + */ + if (pass++ < 3) { put_page(p); - ret = -EIO; + shake_page(p, 1); + count_increased = false; + goto try_again; } + put_page(p); + ret = -EIO; } - +out: return ret; } -static int get_hwpoison_page(struct page *p, unsigned long flags, - enum mf_flags ctxt) +/** + * get_hwpoison_page() - Get refcount for memory error handling + * @p: Raw error page (hit by memory error) + * @flags: Flags controlling behavior of error handling + * + * get_hwpoison_page() takes a page refcount of an error page to handle memory + * error on it, after checking that the error page is in a well-defined state + * (defined as a page-type we can successfully handle the memor error on it, + * such as LRU page and hugetlb page). + * + * Memory error handling could be triggered at any time on any type of page, + * so it's prone to race with typical memory management lifecycle (like + * allocation and free). So to avoid such races, get_hwpoison_page() takes + * extra care for the error page's state (as done in __get_hwpoison_page()), + * and has some retry logic in get_any_page(). + * + * Return: 0 for buddy free pages, + * 1 on success for in-use pages in a well-defined state, + * -EIO for pages on which we can not handle memory errors, + * -EBUSY when get_hwpoison_page() has raced with page lifecycle + * operations like allocation and free. + */ +static int get_hwpoison_page(struct page *p, unsigned long flags) { int ret; zone_pcp_disable(page_zone(p)); - if (ctxt == MF_SOFT_OFFLINE) - ret = get_any_page(p, flags); - else - ret = __get_hwpoison_page(p); + ret = get_any_page(p, flags); zone_pcp_enable(page_zone(p)); return ret; @@ -1384,7 +1394,7 @@ static int memory_failure_hugetlb(unsigned long pfn, int flags) num_poisoned_pages_inc(); - if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p, flags, 0)) { + if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p, flags)) { /* * Check "filter hit" and "race with other subpage." */ @@ -1608,7 +1618,7 @@ int memory_failure(unsigned long pfn, int flags) * In fact it's dangerous to directly bump up page count from 0, * that may make page_ref_freeze()/page_ref_unfreeze() mismatch. */ - if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p, flags, 0)) { + if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p, flags)) { if (is_free_buddy_page(p)) { if (take_page_off_buddy(p)) { page_ref_inc(p); @@ -1900,7 +1910,7 @@ int unpoison_memory(unsigned long pfn) return 0; } - if (!get_hwpoison_page(p, flags, 0)) { + if (!get_hwpoison_page(p, flags)) { if (TestClearPageHWPoison(p)) num_poisoned_pages_dec(); unpoison_pr_info("Unpoison: Software-unpoisoned free page %#lx\n", @@ -2116,7 +2126,7 @@ int soft_offline_page(unsigned long pfn, int flags) retry: get_online_mems(); - ret = get_hwpoison_page(page, flags, MF_SOFT_OFFLINE); + ret = get_hwpoison_page(page, flags); put_online_mems(); if (ret > 0) {