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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AB30C433F5 for ; Sat, 9 Apr 2022 02:07:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E93656B0071; Fri, 8 Apr 2022 22:07:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E425F6B0073; Fri, 8 Apr 2022 22:07:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0BD66B0074; Fri, 8 Apr 2022 22:07:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id BE3606B0071 for ; Fri, 8 Apr 2022 22:07:36 -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 696988249980 for ; Sat, 9 Apr 2022 02:07:36 +0000 (UTC) X-FDA: 79335704112.30.AB29B7C Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf09.hostedemail.com (Postfix) with ESMTP id B971C140002 for ; Sat, 9 Apr 2022 02:07:35 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KZz5M0CffzdZLW; Sat, 9 Apr 2022 10:07:03 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 9 Apr 2022 10:07:33 +0800 Subject: Re: [PATCH v8 3/3] Revert "mm/memory-failure.c: fix race with changing page compound again" To: Naoya Horiguchi CC: Andrew Morton , Mike Kravetz , Yang Shi , Dan Carpenter , Naoya Horiguchi , , Linux-MM References: <20220408135323.1559401-1-naoya.horiguchi@linux.dev> <20220408135323.1559401-4-naoya.horiguchi@linux.dev> From: Miaohe Lin Message-ID: <51ef18d1-284f-5a0b-fd3f-73bb99ec05bb@huawei.com> Date: Sat, 9 Apr 2022 10:07:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220408135323.1559401-4-naoya.horiguchi@linux.dev> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: 68kozi615buwpmd8sz77w7tqfnd56xhq Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: B971C140002 X-HE-Tag: 1649470055-892374 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: On 2022/4/8 21:53, Naoya Horiguchi wrote: > From: Naoya Horiguchi > > Reverts commit 888af2701db7 ("mm/memory-failure.c: fix race with > changing page compound again") because now we fetch the page refcount > under hugetlb_lock in try_memory_failure_hugetlb() so that the race > check is no longer necessary. > Thanks a lot. Reviewed-by: Miaohe Lin > Suggested-by: Miaohe Lin > Signed-off-by: Naoya Horiguchi > --- > include/linux/mm.h | 1 - > include/ras/ras_event.h | 1 - > mm/memory-failure.c | 11 ----------- > 3 files changed, 13 deletions(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 9f44254af8ce..d446e834a3e5 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3251,7 +3251,6 @@ enum mf_action_page_type { > MF_MSG_BUDDY, > MF_MSG_DAX, > MF_MSG_UNSPLIT_THP, > - MF_MSG_DIFFERENT_PAGE_SIZE, > MF_MSG_UNKNOWN, > }; > > diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h > index 1e694fd239b9..d0337a41141c 100644 > --- a/include/ras/ras_event.h > +++ b/include/ras/ras_event.h > @@ -374,7 +374,6 @@ TRACE_EVENT(aer_event, > EM ( MF_MSG_BUDDY, "free buddy page" ) \ > EM ( MF_MSG_DAX, "dax page" ) \ > EM ( MF_MSG_UNSPLIT_THP, "unsplit thp" ) \ > - EM ( MF_MSG_DIFFERENT_PAGE_SIZE, "different page size" ) \ > EMe ( MF_MSG_UNKNOWN, "unknown page" ) > > /* > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index b2e32cdc3823..e2674532678b 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -733,7 +733,6 @@ static const char * const action_page_types[] = { > [MF_MSG_BUDDY] = "free buddy page", > [MF_MSG_DAX] = "dax page", > [MF_MSG_UNSPLIT_THP] = "unsplit thp", > - [MF_MSG_DIFFERENT_PAGE_SIZE] = "different page size", > [MF_MSG_UNKNOWN] = "unknown page", > }; > > @@ -1605,16 +1604,6 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb > return res == MF_RECOVERED ? 0 : -EBUSY; > } > > - /* > - * The page could have changed compound pages due to race window. > - * If this happens just bail out. > - */ > - if (!PageHuge(p) || compound_head(p) != head) { > - action_result(pfn, MF_MSG_DIFFERENT_PAGE_SIZE, MF_IGNORED); > - res = -EBUSY; > - goto out; > - } > - > page_flags = head->flags; > > /* >