Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3505331iob; Tue, 17 May 2022 01:13:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnPcFy7s0afPHVjj0p1IYaMIGtUO7o4sRIQr2iHmPZZ3lzOhBt+ej6MJXP3/9cMUBCVMrh X-Received: by 2002:a62:1613:0:b0:510:82a9:e3bf with SMTP id 19-20020a621613000000b0051082a9e3bfmr21342534pfw.23.1652775191087; Tue, 17 May 2022 01:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652775191; cv=none; d=google.com; s=arc-20160816; b=P956/+DmZR3Ax3u5FHiG2bc5Xt1tUH9U2w3UcVQjkKr5JMJYLgAeBz4xJrMgQcoQvE RfaHgUcmcGMblY40OZPhW4ObiCc+AiMcIgj9BwLfMh+9KH72F7qrAtEc0r+VzRpnvAVd r33g7bGY/2dwTI3pYyTTGjZ38iaC2ZZd7ZLZvyk1BcHVgDTLLdc2H/69c6XCu2KWQqGX fJl2k8r8Cmpiawuy0wOcZn8qcDr3rLdu6RvhYPbq+WN0xEBkK1gJNQ1FJ/iGhGkqoZbp uJM/TnZrRtPS42xXb6FapxeJhG47S4tqquqSJVNBH9gyQbNnJOGf3MWCzhNS6alBO4TI rdLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WgWXSLXeqLI/shSeHdb/lB1tcgUAKlKL99G0NlId0bA=; b=qMvqy1/zf73oHB1ahAY8ymSpUEToMHxQ5IGltat9uskDfeBEuWiMIgHbNGlRmB7qjM 3hM4wHBLh2qJvc0q1EiEJ6YnJAbmSumDJLeSDutqCiqbjl8zqfHX8KidCRH1Khisoqir RGSQg1i1IEgn9vqlUlr/eSP1Pa/bXLKdACFxf8re0U3mgKWyodQ8krF0GpLaJqBJXK3g OSzhI1mwK3znt1mL5M34u4VWiUCD1LO5b2AWwVLRhroyTBIRUTymS7VyfTDUYZ2d39i0 5N5P2Fx+hGwZC6IyFnFNyzn0nxVm9ribqj+wnFMn7z2VkfSrvq5cUpLyQfmMNkWCo8kF TM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ffp/RtRG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a1709027c0400b001569aeb7516si14339847pll.543.2022.05.17.01.12.58; Tue, 17 May 2022 01:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ffp/RtRG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348680AbiEPUXD (ORCPT + 99 others); Mon, 16 May 2022 16:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348876AbiEPT7B (ORCPT ); Mon, 16 May 2022 15:59:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BABDF10; Mon, 16 May 2022 12:51:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3362360ABE; Mon, 16 May 2022 19:51:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2332CC385AA; Mon, 16 May 2022 19:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652730705; bh=xeK6HRxi1mPhpbtlWLLpg+A8vnqO0N4E6B3fLZdB0xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ffp/RtRGNdeLSduB+03h4TXnRwqbWqzlXPmARafLLnAEt9sj0UYBq0jkNe0dMOrvg urlqwmAGBb7aMh0UycQn7GwEevtNs9AliWEusXIF9Qpl3AuVX8FgdmVwdtSN5oH0cO KKyMxDaGDWxTOx06C912jXwcPfkQ1vd2MXrVdQ68= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Yu , Yang Shi , Miaohe Lin , Naoya Horiguchi , Andrew Morton Subject: [PATCH 5.15 082/102] Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()" Date: Mon, 16 May 2022 21:36:56 +0200 Message-Id: <20220516193626.346807892@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516193623.989270214@linuxfoundation.org> References: <20220516193623.989270214@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Yu commit b4e61fc031b11dd807dffc46cebbf0e25966d3d1 upstream. Patch series "mm/memory-failure: rework fix on huge_zero_page splitting". This patch (of 2): This reverts commit d173d5417fb67411e623d394aab986d847e47dad. The commit d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") explicitly skips huge_zero_page in memory_failure(), in order to avoid triggering VM_BUG_ON_PAGE on huge_zero_page in split_huge_page_to_list(). This works, but Yang Shi thinks that, Raising BUG is overkilling for splitting huge_zero_page. The huge_zero_page can't be met from normal paths other than memory failure, but memory failure is a valid caller. So I tend to replace the BUG to WARN + returning -EBUSY. If we don't care about the reason code in memory failure, we don't have to touch memory failure. And for the issue that huge_zero_page will be set PG_has_hwpoisoned, Yang Shi comments that, The anonymous page fault doesn't check if the page is poisoned or not since it typically gets a fresh allocated page and assumes the poisoned page (isolated successfully) can't be reallocated again. But huge zero page and base zero page are reused every time. So no matter what fix we pick, the issue is always there. Finally, Yang, David, Anshuman and Naoya all agree to fix the bug, i.e., to split huge_zero_page, in split_huge_page_to_list(). This reverts the commit d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()"), and the original bug will be fixed by the next patch. Link: https://lkml.kernel.org/r/872cefb182ba1dd686b0e7db1e6b2ebe5a4fff87.1651039624.git.xuyu@linux.alibaba.com Fixes: d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") Fixes: 6a46079cf57a ("HWPOISON: The high level memory error handler in the VM v7") Signed-off-by: Xu Yu Suggested-by: Yang Shi Reviewed-by: Yang Shi Reviewed-by: Miaohe Lin Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/memory-failure.c | 13 ------------- 1 file changed, 13 deletions(-) --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1692,19 +1692,6 @@ try_again: if (PageTransHuge(hpage)) { /* - * Bail out before SetPageHasHWPoisoned() if hpage is - * huge_zero_page, although PG_has_hwpoisoned is not - * checked in set_huge_zero_page(). - * - * TODO: Handle memory failure of huge_zero_page thoroughly. - */ - if (is_huge_zero_page(hpage)) { - action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED); - res = -EBUSY; - goto unlock_mutex; - } - - /* * The flag must be set after the refcount is bumped * otherwise it may race with THP split. * And the flag can't be set in get_hwpoison_page() since