From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3D41C433F5 for ; Wed, 6 Oct 2021 02:35:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D642611CC for ; Wed, 6 Oct 2021 02:35:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7D642611CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 15DC9900002; Tue, 5 Oct 2021 22:35:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10D4A6B0074; Tue, 5 Oct 2021 22:35:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3E73900002; Tue, 5 Oct 2021 22:35:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E10086B0071 for ; Tue, 5 Oct 2021 22:35:48 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8F2908249980 for ; Wed, 6 Oct 2021 02:35:48 +0000 (UTC) X-FDA: 78664447176.30.DF934D0 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf06.hostedemail.com (Postfix) with ESMTP id 4D2BD801BEF6 for ; Wed, 6 Oct 2021 02:35:48 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id x7so3939511edd.6 for ; Tue, 05 Oct 2021 19:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=85A/CcRPHhhXw8lA9VmoZH5xmu6YeHwEGNssFuE34AM=; b=alPUn4l6o6zYJDg47kJX2QWqgVy1dfmAl6MARjpJwoFFmt6O9svnYVl17zWhBuHyJk V2yp/fI9QC5UMDWbsL58PiIGY3Djgw5xVFae0JgbNrLyuRGQFcdgrQ21DnJuTG77LSI8 aBi+OGA7HT3C2vMnN+NeEvZl8U2AsDcNjgMMP/LtSjR6CnmuD0NDJRQti43dzJMQcoFj FzCQNsKnHa+XaRvi2Si1r4UYGt3S4vNOmZEvHE4KOfpsx2iKx4ZVqeNSOD7s4UsEwQgG ut1DNHUUgP8l3Hv4bQ7shtXEYnC9+/TPfQTCHvJva+pIfOu5LEJKowM6Ptf7HKPpt6ux 1BKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=85A/CcRPHhhXw8lA9VmoZH5xmu6YeHwEGNssFuE34AM=; b=Jzgh0AjfPiQxxkVKclGkRkeCi4Kjvd6IyrClu/7F4loGwmWOGAyVDKLa3cOGxbA82b au7YI74RnAPh1XaaJ5EpEABvwzWBBwQezEOkbgEEs4YKpovOlQhM++lfVKQA24dlOVRl 2GS1lwmsGY6MHBz0CfUvSCTkZXNgjFlXjdIMwOT2JFVTgw9yJGdCIEJKtq2vMiKifaWG kV6pNoL1m9gD1EnO8kBJtFJCKhlYsfitx0MJMyn8M7cUc+m0LcH4Y1d5K1isBlQhK27I zmG6tqaDHODpB+fXYOvqqjcSNr0Zp4UVt+xPvH+6vIpYF6UiyPyJoxuCQxhZYRkueB+P axMQ== X-Gm-Message-State: AOAM531BqUrk76FIDHDLsto2Kff5k55vd9tbNZ/V7db7GbrLHd3xzaGj 3nPEFmeoHkeN1OU6h7yCFpBaiTmVeRgGb0ZilHA= X-Google-Smtp-Source: ABdhPJyjAEY2McGhuJwN9uhBXqn2n0pq+eQv3ZQT2FMbgOKU8q35tglFj/tBCEY2Y6naGmP74j/r/2eCHEd1y05zMKQ= X-Received: by 2002:a50:8d85:: with SMTP id r5mr30685431edh.312.1633487747024; Tue, 05 Oct 2021 19:35:47 -0700 (PDT) MIME-Version: 1.0 References: <20210930215311.240774-1-shy828301@gmail.com> <20210930215311.240774-2-shy828301@gmail.com> In-Reply-To: <20210930215311.240774-2-shy828301@gmail.com> From: Yang Shi Date: Tue, 5 Oct 2021 19:35:35 -0700 Message-ID: Subject: Re: [v3 PATCH 1/5] mm: hwpoison: remove the unnecessary THP check To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Peter Xu , Oscar Salvador , Andrew Morton Cc: Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4D2BD801BEF6 X-Stat-Signature: 383hxxmqzu49e5mryn1jotin9ja8zbp9 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=alPUn4l6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-HE-Tag: 1633487748-416214 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 Naoya, Any comment on this patch and patch #3? I'd prefer to fix more comments for a new version. Thanks, Yang On Thu, Sep 30, 2021 at 2:53 PM Yang Shi wrote: > > When handling THP hwpoison checked if the THP is in allocation or free > stage since hwpoison may mistreat it as hugetlb page. After > commit 415c64c1453a ("mm/memory-failure: split thp earlier in memory error > handling") the problem has been fixed, so this check is no longer > needed. Remove it. The side effect of the removal is hwpoison may > report unsplit THP instead of unknown error for shmem THP. It seems not > like a big deal. > > The following patch depends on this, which fixes shmem THP with > hwpoisoned subpage(s) are mapped PMD wrongly. So this patch needs to be > backported to -stable as well. > > Cc: > Suggested-by: Naoya Horiguchi > Signed-off-by: Yang Shi > --- > mm/memory-failure.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 54879c339024..ed28eba50f98 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1147,20 +1147,6 @@ static int __get_hwpoison_page(struct page *page) > if (!HWPoisonHandlable(head)) > return -EBUSY; > > - 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; > -- > 2.26.2 >