From patchwork Tue May 11 15:10:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12251333 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=-8.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 C1488C433B4 for ; Tue, 11 May 2021 15:10:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 42B2161396 for ; Tue, 11 May 2021 15:10:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42B2161396 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 99F196B006E; Tue, 11 May 2021 11:10:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94E036B0072; Tue, 11 May 2021 11:10:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C82E6B0074; Tue, 11 May 2021 11:10:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 5F4736B006E for ; Tue, 11 May 2021 11:10:33 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1BAC11F0A for ; Tue, 11 May 2021 15:10:33 +0000 (UTC) X-FDA: 78129286746.39.6D382A7 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by imf28.hostedemail.com (Postfix) with ESMTP id 7CFC7200027C for ; Tue, 11 May 2021 15:10:31 +0000 (UTC) Received: by mail-pg1-f171.google.com with SMTP id l70so1267340pga.1 for ; Tue, 11 May 2021 08:10:32 -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:mime-version :content-transfer-encoding; bh=DwTrcsYF66Ci4WqwAE8b4kjaAXXOd3wz6jRbttr9oyU=; b=L9K3mMvViE1Oc7+lgOxeFPBpl/ORwxmksqUJFWQTLQW4ErZeqwC1WCy68gijKQWiGl DeXTkYx1M0XqgjE8g3ug701R/20dso1WytlXhcjFUgQza/OFtGbBt4n9VvqI+VkWxsDO Xp4axad5iDPZ2fqqhBtvuKtvQAU+mIVL/8GwhPGXFLWFrXwAfGWH7nDPXK8iFJp4uB8t 3OGaY5emBnVef+kJ+RYggM7mSBawtSCTHxVEXeCmK5OOTpzjigu0g49FAA4boVAyr9sk qFKSVAsp5reOVNi9qP95eZH20ykLYitXGy3ZMAgLK+Z0BvIywpyi/idmIl3/fTVqL0Oz gJPA== 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:mime-version :content-transfer-encoding; bh=DwTrcsYF66Ci4WqwAE8b4kjaAXXOd3wz6jRbttr9oyU=; b=IJFlxUNxGDDmuwTd/MnXRPOzAYuwpXj6XuGFwNoTUHErv7mMS2TcxGP2md1pk7aPoG ISr6lb66RYlCX0nWggFLjCAchq0g/gUCie3+ZlFKO3D8QRuR+eaVz7KCMJyLAPLaulcw ijNlVgqQmRIINwLa6xOZlzm/rkpM39tEjQsNzITxLj970DIQxjJplVCb3OMfOMJEWAMW LCMOI8zu+8x0Gjn8bhriaUfaPGpXfFqpHKP3HCSmcVMoFA+qQTm26vOxPy66SpUZ+Ru7 dfpgT+r7gkLTRZQyvL6sTqpoPRUI/whwxDb4tpFTt7LdNTNadZIxO6M1s/kr3Ly8dNt+ sVkQ== X-Gm-Message-State: AOAM530NTndI7VNL+910JRtb0InlEy54RNIre/3jrcTHhtPmR5KY/2kl 543dKdGUZre2oIWgeLs0GA== X-Google-Smtp-Source: ABdhPJz7fhGDJwFP00HK7oSVwROpieLkppPXHXun2qSM3/6m8RjXJQ5NRGR+gU8Vyfm7BHcgBzXKwA== X-Received: by 2002:a63:2115:: with SMTP id h21mr31517103pgh.191.1620745831722; Tue, 11 May 2021 08:10:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 08:10:31 -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 0/2] hwpoison: fix race with compound page allocation Date: Wed, 12 May 2021 00:10:14 +0900 Message-Id: <20210511151016.2310627-1-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=L9K3mMvV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-Stat-Signature: 1oywh4p5irkbrx641j7jmo89xkrs96kq X-Rspamd-Queue-Id: 7CFC7200027C X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mail-pg1-f171.google.com; client-ip=209.85.215.171 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620745831-599282 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: Hi everyone, I updated the patch for the issue reported by Muchun Song in [1]. I separated into two patches (to reduce the size of core fix for stable): patch 1/2 focuses on preventing VM_BUG_ON_PAGE() in the reported race. Patch 2/2 includes some code improvement like calling retry code, revising the function comment, and some refactoring. Any comment and testing would be appreciated. Thanks, Naoya Horiguchi [1] https://lore.kernel.org/linux-mm/20210421060259.67554-1-songmuchun@bytedance.com/T/ --- Summary: Naoya Horiguchi (2): mm,hwpoison: fix race with compound page allocation mm,hwpoison: make get_hwpoison_page call get_any_page() mm/memory-failure.c | 169 +++++++++++++++++++++++++++++----------------------- 1 file changed, 96 insertions(+), 73 deletions(-)