From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 875D7C433EF for ; Thu, 10 Feb 2022 14:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240405AbiBJOVa (ORCPT ); Thu, 10 Feb 2022 09:21:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242811AbiBJOVS (ORCPT ); Thu, 10 Feb 2022 09:21:18 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58ABB27C for ; Thu, 10 Feb 2022 06:21:17 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf643BNwzbk7H; Thu, 10 Feb 2022 22:20:12 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:14 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 1/8] mm/memory-failure.c: minor clean up for memory_failure_dev_pagemap Date: Thu, 10 Feb 2022 22:17:26 +0800 Message-ID: <20220210141733.1908-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The flags always has MF_ACTION_REQUIRED and MF_MUST_KILL set. So we do not need to check these flags again. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 55edb0cc3848..b3ff7e99a421 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1644,7 +1644,7 @@ static int memory_failure_dev_pagemap(unsigned long p= fn, int flags, * SIGBUS (i.e. MF_MUST_KILL) */ flags |=3D MF_ACTION_REQUIRED | MF_MUST_KILL; - collect_procs(page, &tokill, flags & MF_ACTION_REQUIRED); + collect_procs(page, &tokill, true); =20 list_for_each_entry(tk, &tokill, nd) if (tk->size_shift) @@ -1659,7 +1659,7 @@ static int memory_failure_dev_pagemap(unsigned long p= fn, int flags, start =3D (page->index << PAGE_SHIFT) & ~(size - 1); unmap_mapping_range(page->mapping, start, size, 0); } - kill_procs(&tokill, flags & MF_MUST_KILL, false, pfn, flags); + kill_procs(&tokill, true, false, pfn, flags); rc =3D 0; unlock: dax_unlock_page(page, cookie); --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 175E8C433FE for ; Thu, 10 Feb 2022 14:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242824AbiBJOVX (ORCPT ); Thu, 10 Feb 2022 09:21:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236634AbiBJOVS (ORCPT ); Thu, 10 Feb 2022 09:21:18 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 387E221B for ; Thu, 10 Feb 2022 06:21:17 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf646DzLzbkBd; Thu, 10 Feb 2022 22:20:12 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:14 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 2/8] mm/memory-failure.c: avoid walking page table when vma_address() return -EFAULT Date: Thu, 10 Feb 2022 22:17:27 +0800 Message-ID: <20220210141733.1908-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" It's unnecessary to walk the page table when vma_address() return -EFAULT. Return early if so to save some cpu cycles. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index b3ff7e99a421..f86819145ea8 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -315,6 +315,8 @@ static unsigned long dev_pagemap_mapping_shift(struct p= age *page, pmd_t *pmd; pte_t *pte; =20 + if (address =3D=3D -EFAULT) + return 0; pgd =3D pgd_offset(vma->vm_mm, address); if (!pgd_present(*pgd)) return 0; --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7565C4332F for ; Thu, 10 Feb 2022 14:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242845AbiBJOV0 (ORCPT ); Thu, 10 Feb 2022 09:21:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238798AbiBJOVS (ORCPT ); Thu, 10 Feb 2022 09:21:18 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91A5189 for ; Thu, 10 Feb 2022 06:21:17 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Jvf654whlzcc5l; Thu, 10 Feb 2022 22:20:13 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:15 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 3/8] mm/memory-failure.c: rework the signaling logic in kill_proc Date: Thu, 10 Feb 2022 22:17:28 +0800 Message-ID: <20220210141733.1908-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" BUS_MCEERR_AR code is only sent when MF_ACTION_REQUIRED is set and the target is current. Rework the code to make this clear. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index f86819145ea8..2dd7f35ee65a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -258,16 +258,13 @@ static int kill_proc(struct to_kill *tk, unsigned lon= g pfn, int flags) pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware mem= ory corruption\n", pfn, t->comm, t->pid); =20 - if (flags & MF_ACTION_REQUIRED) { - if (t =3D=3D current) - ret =3D force_sig_mceerr(BUS_MCEERR_AR, - (void __user *)tk->addr, addr_lsb); - else - /* Signal other processes sharing the page if they have PF_MCE_EARLY se= t. */ - ret =3D send_sig_mceerr(BUS_MCEERR_AO, (void __user *)tk->addr, - addr_lsb, t); - } else { + if ((flags & MF_ACTION_REQUIRED) && (t =3D=3D current)) + ret =3D force_sig_mceerr(BUS_MCEERR_AR, + (void __user *)tk->addr, addr_lsb); + else /* + * Signal other processes sharing the page if they have + * PF_MCE_EARLY set. * Don't use force here, it's convenient if the signal * can be temporarily blocked. * This could cause a loop when the user sets SIGBUS @@ -275,7 +272,6 @@ static int kill_proc(struct to_kill *tk, unsigned long = pfn, int flags) */ ret =3D send_sig_mceerr(BUS_MCEERR_AO, (void __user *)tk->addr, addr_lsb, t); /* synchronous? */ - } if (ret < 0) pr_info("Memory failure: Error sending signal to %s:%d: %d\n", t->comm, t->pid, ret); --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAF72C433F5 for ; Thu, 10 Feb 2022 14:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242862AbiBJOVk (ORCPT ); Thu, 10 Feb 2022 09:21:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242832AbiBJOVU (ORCPT ); Thu, 10 Feb 2022 09:21:20 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C9B1DC for ; Thu, 10 Feb 2022 06:21:19 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Jvf3Z4My2zdZW7; Thu, 10 Feb 2022 22:18:02 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:15 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 4/8] mm/memory-failure.c: remove unneeded orig_head Date: Thu, 10 Feb 2022 22:17:29 +0800 Message-ID: <20220210141733.1908-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" orig_head is used to check whether the page have changed compound pages during the locking. But it's always equal to hpage. So we can use hpage directly and remove this redundant one. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2dd7f35ee65a..4370c2f407c5 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1691,7 +1691,6 @@ int memory_failure(unsigned long pfn, int flags) { struct page *p; struct page *hpage; - struct page *orig_head; struct dev_pagemap *pgmap; int res =3D 0; unsigned long page_flags; @@ -1737,7 +1736,7 @@ int memory_failure(unsigned long pfn, int flags) goto unlock_mutex; } =20 - orig_head =3D hpage =3D compound_head(p); + hpage =3D compound_head(p); num_poisoned_pages_inc(); =20 /* @@ -1821,7 +1820,7 @@ int memory_failure(unsigned long pfn, int flags) * The page could have changed compound pages during the locking. * If this happens just bail out. */ - if (PageCompound(p) && compound_head(p) !=3D orig_head) { + if (PageCompound(p) && compound_head(p) !=3D hpage) { action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED); res =3D -EBUSY; goto unlock_page; --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D20DC433FE for ; Thu, 10 Feb 2022 14:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242885AbiBJOVh (ORCPT ); Thu, 10 Feb 2022 09:21:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242826AbiBJOVT (ORCPT ); Thu, 10 Feb 2022 09:21:19 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE0B61D5 for ; Thu, 10 Feb 2022 06:21:18 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf661HWPzbkD0; Thu, 10 Feb 2022 22:20:14 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:15 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 5/8] mm/memory-failure.c: remove PageSlab check in hwpoison_filter_dev Date: Thu, 10 Feb 2022 22:17:30 +0800 Message-ID: <20220210141733.1908-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit 03e5ac2fc3bf ("mm: fix crash when using XFS on loopback"), page_mapping() can handle the Slab pages. So remove this unnecessary PageSlab check and obsolete comment. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4370c2f407c5..71bd78279669 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -130,12 +130,6 @@ static int hwpoison_filter_dev(struct page *p) hwpoison_filter_dev_minor =3D=3D ~0U) return 0; =20 - /* - * page_mapping() does not accept slab pages. - */ - if (PageSlab(p)) - return -EINVAL; - mapping =3D page_mapping(p); if (mapping =3D=3D NULL || mapping->host =3D=3D NULL) return -EINVAL; --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F5A2C433EF for ; Thu, 10 Feb 2022 14:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242858AbiBJOVc (ORCPT ); Thu, 10 Feb 2022 09:21:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242817AbiBJOVS (ORCPT ); Thu, 10 Feb 2022 09:21:18 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D01562C5 for ; Thu, 10 Feb 2022 06:21:18 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf5X00fsz9sY6; Thu, 10 Feb 2022 22:19:43 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:16 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 6/8] mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings() Date: Thu, 10 Feb 2022 22:17:31 +0800 Message-ID: <20220210141733.1908-7-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Only for hugetlb pages in shared mappings, try_to_unmap should take semaphore in write mode here. Rework the code to make it clear. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 71bd78279669..78aba0b3e983 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1405,26 +1405,22 @@ static bool hwpoison_user_mappings(struct page *p, = unsigned long pfn, if (kill) collect_procs(hpage, &tokill, flags & MF_ACTION_REQUIRED); =20 - if (!PageHuge(hpage)) { - try_to_unmap(hpage, ttu); + if (PageHuge(hpage) && !PageAnon(hpage)) { + /* + * For hugetlb pages in shared mappings, try_to_unmap + * could potentially call huge_pmd_unshare. Because of + * this, take semaphore in write mode here and set + * TTU_RMAP_LOCKED to indicate we have taken the lock + * at this higher level. + */ + mapping =3D hugetlb_page_mapping_lock_write(hpage); + if (mapping) { + try_to_unmap(hpage, ttu|TTU_RMAP_LOCKED); + i_mmap_unlock_write(mapping); + } else + pr_info("Memory failure: %#lx: could not lock mapping for mapped huge p= age\n", pfn); } else { - if (!PageAnon(hpage)) { - /* - * For hugetlb pages in shared mappings, try_to_unmap - * could potentially call huge_pmd_unshare. Because of - * this, take semaphore in write mode here and set - * TTU_RMAP_LOCKED to indicate we have taken the lock - * at this higher level. - */ - mapping =3D hugetlb_page_mapping_lock_write(hpage); - if (mapping) { - try_to_unmap(hpage, ttu|TTU_RMAP_LOCKED); - i_mmap_unlock_write(mapping); - } else - pr_info("Memory failure: %#lx: could not lock mapping for mapped huge = page\n", pfn); - } else { - try_to_unmap(hpage, ttu); - } + try_to_unmap(hpage, ttu); } =20 unmap_success =3D !page_mapped(hpage); --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39E78C433F5 for ; Thu, 10 Feb 2022 14:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242886AbiBJOVo (ORCPT ); Thu, 10 Feb 2022 09:21:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242834AbiBJOVU (ORCPT ); Thu, 10 Feb 2022 09:21:20 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D68D102 for ; Thu, 10 Feb 2022 06:21:20 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf670JzZzbjjQ; Thu, 10 Feb 2022 22:20:15 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:16 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 7/8] mm/memory-failure.c: remove obsolete comment in __soft_offline_page Date: Thu, 10 Feb 2022 22:17:32 +0800 Message-ID: <20220210141733.1908-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit add05cecef80 ("mm: soft-offline: don't free target page in successful page migration"), set_migratetype_isolate logic is removed. Remove this obsolete comment. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 78aba0b3e983..3d0803a13703 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2161,10 +2161,6 @@ static int __soft_offline_page(struct page *page) ret =3D invalidate_inode_page(page); unlock_page(page); =20 - /* - * RED-PEN would be better to keep it isolated here, but we - * would need to fix isolation locking first. - */ if (ret) { pr_info("soft_offline: %#lx: invalidated\n", pfn); page_handle_poison(page, false, true); --=20 2.23.0 From nobody Sun Jun 28 07:37:22 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E74C9C433F5 for ; Thu, 10 Feb 2022 14:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242903AbiBJOVm (ORCPT ); Thu, 10 Feb 2022 09:21:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242835AbiBJOVU (ORCPT ); Thu, 10 Feb 2022 09:21:20 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 949BCF5 for ; Thu, 10 Feb 2022 06:21:20 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jvf5X67DJz9sbB; Thu, 10 Feb 2022 22:19:44 +0800 (CST) Received: from huawei.com (10.175.124.27) 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.2308.21; Thu, 10 Feb 2022 22:21:17 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 8/8] mm/memory-failure.c: remove unnecessary PageTransTail check Date: Thu, 10 Feb 2022 22:17:33 +0800 Message-ID: <20220210141733.1908-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220210141733.1908-1-linmiaohe@huawei.com> References: <20220210141733.1908-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When we reach here, we're guaranteed to have non-compound page as thp is already splited. Remove this unnecessary PageTransTail check. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 3d0803a13703..3e404b06efdc 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1838,7 +1838,7 @@ int memory_failure(unsigned long pfn, int flags) * page_lock. We need wait writeback completion for this page or it * may trigger vfs BUG while evict inode. */ - if (!PageTransTail(p) && !PageLRU(p) && !PageWriteback(p)) + if (!PageLRU(p) && !PageWriteback(p)) goto identify_page_state; =20 /* --=20 2.23.0