From patchwork Mon May 17 04:54:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12260827 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 61C35C433ED for ; Mon, 17 May 2021 04:54:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E0DD66113C for ; Mon, 17 May 2021 04:54:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0DD66113C 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 83F7D6B006E; Mon, 17 May 2021 00:54:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77B2C6B0070; Mon, 17 May 2021 00:54:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61C9D6B0071; Mon, 17 May 2021 00:54:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 2B0D16B006E for ; Mon, 17 May 2021 00:54:12 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C5F7D9991 for ; Mon, 17 May 2021 04:54:11 +0000 (UTC) X-FDA: 78149506302.28.1827BD3 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf19.hostedemail.com (Postfix) with ESMTP id 3300D90009E8 for ; Mon, 17 May 2021 04:54:10 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id gc22-20020a17090b3116b02901558435aec1so2983581pjb.4 for ; Sun, 16 May 2021 21:54:11 -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=Wv9HmEbNzXquV71c2I1HoKTY3dM9rr3O2ebUyy9oJlA=; b=J3O71pOfBC4c67/UCF1GYqUXtR5/eWHqt4hyfGm49iNpD/8JW8r9V4JfzVONbW/Rw1 +Ne7KuuufvOrCP8dFI0DzQVTPzJ8EZFnn1pFgZXRhdg92Ko8L02es1+iKLQKjQ1fO1jO P2xr4Ox+ZApexHrUA8b9s9wKPZ2VANWuIsjqdRxRwMRfTMiGD1r5qXsxmAn+C7rYhN3o iyxNtTI9wuZTFEbbGF8pZyfycFGTXHYmXBO3AFBdXc22t9eP5jszvMOioXqbSyEyWSjw QDoruDTCzwEvi7e4IheT+MPQtlzPX+CVFbHGA7twyvPYhYDSfxBNCAlgPv2/XjX6ToAO dcxQ== 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=Wv9HmEbNzXquV71c2I1HoKTY3dM9rr3O2ebUyy9oJlA=; b=kFnaXAWtNUw0rvIsztIhQ2PaDJiMIkj+QuxcqJ6sCPzuYtJGh/hHOhRf+EM+EjQjob RxxT63FeUaUrgPCw9qdW3HQGUzVO6+8Wn2TlmpFeIqkE7i32l6fwaxria0CbyE3gmcm7 GHoR/ExERXxfApUeLHgIitpx3VCYvXo3K9x+iIGAPPpqqx2oVZdhlbQbjLL8qLuG+p0K wh8KyPsgAJP+cR0+jfmxPZA/rBXoK+Ux2HjsD4HZ3dsF43ana0l4nRwDR9A2EG+TUIw/ VVrjjHcT/0DofsDtAwRXrKghXvShIH9GCq6YCncGOSAi9NVd6OPHfe7FKT4xpkAIrvKz Go1Q== X-Gm-Message-State: AOAM531N0BA9Nip8g0eoAlV3lAKUzr4xPa7vy1iM54OqYFQ4n4R0Iod+ VgNdTAYcW3QnAzXIa8hhow== X-Google-Smtp-Source: ABdhPJyxCSt0gPoL3zDCxj/Lgxk1wqc86x5Lgwrtz6EXekFEtEzmYEAhJFBEvTXHIkXT0eyiA3gKww== X-Received: by 2002:a17:90a:da06:: with SMTP id e6mr24442241pjv.183.1621227250533; Sun, 16 May 2021 21:54:10 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id j29sm9439038pgl.30.2021.05.16.21.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 21:54:10 -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 v4 1/2] mm,hwpoison: fix race with compound page allocation Date: Mon, 17 May 2021 13:54:00 +0900 Message-Id: <20210517045401.2506032-2-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517045401.2506032-1-nao.horiguchi@gmail.com> References: <20210517045401.2506032-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=J3O71pOf; spf=pass (imf19.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3300D90009E8 X-Stat-Signature: ftxwox6xznntqedk7xgyxew57dzioa3c X-HE-Tag: 1621227250-445621 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 overcommitting 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 a time window 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 v4: - all hugetlb related check in hugetlb_lock, - fix build error with #ifdef CONFIG_HUGETLB_PAGE --- mm/memory-failure.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git v5.12/mm/memory-failure.c v5.12_patched/mm/memory-failure.c index a3659619d293..761f982b6d7b 100644 --- v5.12/mm/memory-failure.c +++ v5.12_patched/mm/memory-failure.c @@ -1094,6 +1094,16 @@ static int page_action(struct page_state *ps, struct page *p, static int __get_hwpoison_page(struct page *page) { struct page *head = compound_head(page); + int ret = 0; + +#ifdef CONFIG_HUGETLB_PAGE + spin_lock(&hugetlb_lock); + if (PageHuge(head) && (HPageFreed(head) || HPageMigratable(head))) + ret = get_page_unless_zero(head); + spin_unlock(&hugetlb_lock); + if (ret > 0) + return ret; +#endif if (!PageHuge(head) && PageTransHuge(head)) { /* From patchwork Mon May 17 04:54:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12260829 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 47294C433B4 for ; Mon, 17 May 2021 04:54:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF13E6113C for ; Mon, 17 May 2021 04:54:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF13E6113C 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 559C36B0070; Mon, 17 May 2021 00:54:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E1356B0071; Mon, 17 May 2021 00:54:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 336966B0072; Mon, 17 May 2021 00:54:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id EF05E6B0070 for ; Mon, 17 May 2021 00:54:14 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7D00A98BF for ; Mon, 17 May 2021 04:54:14 +0000 (UTC) X-FDA: 78149506428.40.5AC69E9 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf06.hostedemail.com (Postfix) with ESMTP id 594A5C0007C4 for ; Mon, 17 May 2021 04:54:13 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id x188so4117380pfd.7 for ; Sun, 16 May 2021 21:54:13 -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=a91cKIOAtNxgkwYYfV45C+J1SqqN2xQcmJEtOXolKqY=; b=ije35DqWzzaJoVjfbdhDmWp2z2qlIIyNFRNP5oj8PdcJCfWxrpcMJNVvjIxkE0sVQ+ Fz37lJni5dGx1XjJFqxWO7BC9BdgIns7kJ6OfvdRc6ivURDLvcnvDsi/fAM2F4ZDCQQU 7kMZF4Q9vId/lAgeLi4TmwoBxfjNJCqvzaNAT6qxLwlHSa+Tr3G4mRdYpfyhNOk9om37 QvKWpct5prJH4Db2UOf7IcG1NsaBM201nDc2ruTla201CXY4yaVIHKhJ6UnKsklwyXM8 RYM5EBbj9A5F6Kk+J2jtZAbvXS5h5BS7UYSzF1MlTNRvVn1gtSKwq1UOqN8CsEftXfJt ix4A== 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=a91cKIOAtNxgkwYYfV45C+J1SqqN2xQcmJEtOXolKqY=; b=kjLvfV2raSocloktz7Zx5/uJ0p/ozSIAxNm3ZHFmqMwIMP41LhvuUZm+KPPe0qv73K YRbeb7fF1qVwne2yVuwYjkBU4NhG5spNuAjsxwmVC0CBLvJPbu0j3GM0lRokMq/bINlR +PlX227phDjwEinu5m4SsJggL2WNrrPPvJtoEXCeingmfgTBWrphZ5FTmVDX6HGTnpnE X25cjOts/r+JqbFBcI7Wz1n5Ey3j2PbjQFuRi1nx54v821ozzCX7Ey0LtsLZFX0dbD6v o63w9SojwcBIwCCuMyQ+WLQzfto6hwU0uo2v6776r+aNQThxZ51drPZjGmHjr6MCQJ59 Vaeg== X-Gm-Message-State: AOAM530FhNvBGZOHbcjAJcXExQQSsQBqLXZZgkssXi3iH4WC8ZuUwUgZ FWEf6nTz7F75HaZ/P4WdAQ== X-Google-Smtp-Source: ABdhPJwFk4Q8UGF7UMgeYJgHd2I3/KF8Ek+miNEwGrRQqkU820ff0VXZ+o+O1Sc0mspFaXtGh8TG5Q== X-Received: by 2002:a63:da0a:: with SMTP id c10mr59513361pgh.255.1621227253126; Sun, 16 May 2021 21:54:13 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id j29sm9439038pgl.30.2021.05.16.21.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 21:54:12 -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 v4 2/2] mm,hwpoison: make get_hwpoison_page call get_any_page() Date: Mon, 17 May 2021 13:54:01 +0900 Message-Id: <20210517045401.2506032-3-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517045401.2506032-1-nao.horiguchi@gmail.com> References: <20210517045401.2506032-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ije35DqW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 594A5C0007C4 X-Stat-Signature: mwq8gunpiwfnmu6b5xtupbxkb8afgwzk X-HE-Tag: 1621227253-981788 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 __get_hwpoison_page() could fail to grab refcount by some race condition, so it's helpful if we can 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 --- ChangeLog v4: - __get_hwpoison_page() returns -EBUSY (not in the previous patch), - moved "if (ret == -EBUSY)" block, - improved comment. --- mm/memory-failure.c | 114 ++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git v5.12/mm/memory-failure.c v5.12_patched/mm/memory-failure.c index 761f982b6d7b..85275972cc6f 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); @@ -1098,7 +1091,9 @@ static int __get_hwpoison_page(struct page *page) #ifdef CONFIG_HUGETLB_PAGE spin_lock(&hugetlb_lock); - if (PageHuge(head) && (HPageFreed(head) || HPageMigratable(head))) + if (!PageHuge(head)) + ret = -EBUSY; + else if (HPageFreed(head) || HPageMigratable(head)) ret = get_page_unless_zero(head); spin_unlock(&hugetlb_lock); if (ret > 0) @@ -1131,15 +1126,6 @@ static int __get_hwpoison_page(struct page *page) return 0; } -/* - * 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; @@ -1149,50 +1135,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 (!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; + } else if (ret == -EBUSY) { + /* We raced with freeing huge page to buddy, retry. */ if (pass++ < 3) goto try_again; - ret = -EIO; } + } + + 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 on failure, + * 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; @@ -1381,7 +1393,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." */ @@ -1605,7 +1617,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); @@ -1897,7 +1909,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", @@ -2113,7 +2125,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) {