From patchwork Wed Jun 12 07:18:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694529 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 D3F95C27C53 for ; Wed, 12 Jun 2024 07:22:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 529C36B0163; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BD4E6B0165; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 351F46B0164; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 161DD6B0162 for ; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B2D0D1C265A for ; Wed, 12 Jun 2024 07:22:25 +0000 (UTC) X-FDA: 82221393450.28.97D921D Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf20.hostedemail.com (Postfix) with ESMTP id 3E1AC1C0012 for ; Wed, 12 Jun 2024 07:22:22 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176944; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h5v248dKscUzY2hnQdiMAKgssiOpynXDkWMMYLsa818=; b=27vCrz0Pm+C/yhib4zCFLQy52LPkzRtnCU3E0b+fgw1bD0zGSKCkn4tTRFWChgGXahh0F3 1mRqRAWQXHNbkwCDV2swbHDTiddxcydOHUhNSgNifGYVHqbSqcdBAW0TOypHzXXZRGuAvd BSSfe7v+MGVIwV/3dsSW8puyYInH8QE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176944; a=rsa-sha256; cv=none; b=eugz7PNQGB1ZLD+EjTILMzDxTnwvdMIgz8gFf+v3bKuEhVtKG4EJfGJspBHFm0nnV6Tuww 6hIJ+8BbvOstY0AVcb21ZDOA/gckZoWiK7IdPi5uzUhzRMeGnRkXbaFqQnZ9S3MYtuTuYA ETcWN3dQEUp9h/37W+IFyD3zRePbPo4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VzcMr4lcQz355t4; Wed, 12 Jun 2024 15:18:32 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id E837B180065; Wed, 12 Jun 2024 15:22:19 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:19 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 01/13] mm/memory-failure: simplify put_ref_page() Date: Wed, 12 Jun 2024 15:18:23 +0800 Message-ID: <20240612071835.157004-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: 1zy7cq9izx5ztzxihtozxbjrnjpwq799 X-Rspamd-Queue-Id: 3E1AC1C0012 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718176942-905446 X-HE-Meta: U2FsdGVkX1/EFHs0ZSfeq7zKhMgzLl386g/s8/kWzZxg8UJH1l+USnkMTf13WTCncWIB8xVmzJYGCE5cWYyEsgpDmsQXEGhKpmmuiCbdzzig1DlRu67gwldyGliviV816nUy0ZamChPmdXr6wFrbMLYcjcadK8rmYLOITtkdP7vE2uS71g+6dpspF2eN81hNBSdNFkkxRrP/Hjice79RlJVIhQhuy8WxQhBGqRKJAlazqVmeMrohtKGT6PPzKLf2uVwDPb9ukbY6zxv2M3ljzmLDIztoX/Ziv6u3LF7t7luU14X30p8vGwbFGtJdCulqoyTevXfXM15sG1Hh27NFUzZ2PuaKCRh4cW4QX6xMQpGt1003JgTMBABkn7qQlmg5r9h5OsaG37L9BvBxFXZnJZYe/R7JL0WRysE7FMgCNA/Xl8E3hwBKHoSVZ/EenqWL+pJ9ngzSEP/d4MP6o4Bo93CObsQfy5EalpmgoxUyJbyo1Hvb7Ls7ohpcNTyqY4OA+cVSDAwUZw3xo7vUsBUvpPADxmXK+S4Kk5CngQYpqPItPLnkESOseElM46fd97ayyytRVwsA3UyafX100Y3nHAw6PsSZHWYv8SzCWBYgpsSeMOQjfOVEjcPgndRQgbEf0Qlt2+VJSj0czRTvGXmCu034wr7t7cOCaptlWM6mf9k6W6YoqDohB1W8kI/geW82ACFcNs1HR7FnZcw/0sLwowBEkLZibhyRrP5Dupwk6YdHfSKSmlxS2MibR5X+TgTIlD5GLTjacFoX0pJRtpKbPym0ZMS5mnvDoCaukaY+GVT7zP6RibtZYWzzmug3qkSEaAuv+ejg4zYDPn+IFUhqT5W7jd9CHNRa4870eJahARfn1KvHxvOIq54gmCqAlVhezazLGmKedxLZOGx5J0mrZEf9bPaqSoBZ/u8EVwbTil9qme0Rg+DUr7koHEfNvy1zDh8iKGc63Mih3wZrpYT 7tjdgDE2 EJO6A8JxNd4bbzgyk0MQiIt6SK8a+6UNzAXAHxHEcs7kJBz1tF7pBYmInV8/VrdpBdPD7SboXWKf06pn7ybVUA9ZNuOoXd78fadOLbOHHWczkYnQmg1z04OZLhWEmowrKnL2eU7YKLJyL8Aj9xJtv2TvCts1HUV/I/VsQDDROwFpXUnxy54smrkmz9zet7rBzibGCWbSBD50nhoLasQ0WtEoXpuoaYSxWdLigEH0F5JZTJ8HPdSSoJq7sEoSi5EBTuKT3 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: List-Subscribe: List-Unsubscribe: Remove unneeded page != NULL check. pfn_to_page() won't return NULL. No functional change intended. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index f679b579d45d..2e6038c73119 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2120,14 +2120,10 @@ static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) /* Drop the extra refcount in case we come from madvise() */ static void put_ref_page(unsigned long pfn, int flags) { - struct page *page; - if (!(flags & MF_COUNT_INCREASED)) return; - page = pfn_to_page(pfn); - if (page) - put_page(page); + put_page(pfn_to_page(pfn)); } static int memory_failure_dev_pagemap(unsigned long pfn, int flags, From patchwork Wed Jun 12 07:18:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694531 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 ADF8EC27C53 for ; Wed, 12 Jun 2024 07:22:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01FAF6B0165; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EEAA86B0167; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8B236B0168; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BA0516B0165 for ; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6D319A2EFD for ; Wed, 12 Jun 2024 07:22:26 +0000 (UTC) X-FDA: 82221393492.05.CB57E8E Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf10.hostedemail.com (Postfix) with ESMTP id 3EDDCC0002 for ; Wed, 12 Jun 2024 07:22:23 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176944; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BSewUx7ahD4U7wfKNpBewFAAciTcYdRKdsjjFiMtqFw=; b=eIYa/hOtecnRKWhPuxtwC1+M5mcXbItC5E1FrrTAUsGMxe7CLfU4i+gVFBib31OrVvx/i/ TWyyBGbr5uUPBMDgKIWx4gEHdT1wSGgdgDCYSvFW3wKOqrAQAILlTEQo/F8PYtlovzm02b tqdEHTs3o3JuVpNZysTuZkX8tlYSdCk= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176944; a=rsa-sha256; cv=none; b=gQeW60dr6GKHApDfBB6fT8ClLw/FSNP6QisfnvMy4qOuLXVE2VhKmgCy7mhKXJjKT+l33E DQ135oRDDkGyb3emiJtv+2fFEZLMAGHP1cnJQVr0TDz6gNKmwA7XDw5dzyNlTLBZdTCmh7 oDpxWB46wt/ayVrlNPBMtgt7Mt65CHQ= Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VzcQ1401Fz1HDJm; Wed, 12 Jun 2024 15:20:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 6F53C180065; Wed, 12 Jun 2024 15:22:20 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:19 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 02/13] mm/memory-failure: remove MF_MSG_SLAB Date: Wed, 12 Jun 2024 15:18:24 +0800 Message-ID: <20240612071835.157004-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Queue-Id: 3EDDCC0002 X-Rspamd-Server: rspam01 X-Stat-Signature: i9heme6pu5ygkd7c5f58ozgr3kir6csx X-HE-Tag: 1718176943-39253 X-HE-Meta: U2FsdGVkX1+0kWnsOs+r06YBBLWiQKOIlYW2Q7qICVFoi3MOVS0RF2sZAV/NdEn1F4XqQfbC8ieyAkl3QHDahWS42VqYhsRbHUrf2vcxRrHUXLmQhS7hdXttLGaSXrar2MPj2Pl2Jv33nhawYa1o6R0Vno4fI3WaEBNapJxHHZwNlIJcrG4ZnSodFWP1mpjVHMrOurHCzkUpU66bHohyFwGuJwPyZCAozZPcHTg/6YdHZa+ZNsW0HJKGS+6UNnGguT0rx3gMpn3v7nV4r2sQRvXbUqjValQs7/DBPEf44gSSq+Oqkk92V+Sj6eB8UTuxZpGzmrBp8kX8/YjH+NGEZ0/uE8M0UsZ85/wYC+BycpBHNwjHB5L9Ys9rAs3IDRupEOumJajrO6GPpTTHrRoPtMpEUm6Zqz8j7xRvKpcmZX/X7XniqQUQoZh9lOG3c80AqahhiwqaUJZ1Kv6YkKC4+lIQoE0gpa9lX/I8FgzICCDtNDZGFo73LDA6DD6Tf/0kANZglZs15NYVOu2GbBy0A+qAjuwt15oA3aXAIbFFwVGudDxbXwZGvOPGTh2pn1XKRVa43Derok/jfoT7ovTiVLgwDWyVuMxXUULeCA7FXaWfYNM4hZ/MgoGTA2nWCJOLmKWmrygYKFjmhiZjrGSBA8wmuG7K4M+/ajyigfhKns3lcdDidPWN4STuuqMX9TAmgPZrtYue7v/kIY/U0/9eGWIdsBQsGv3Oio1e/k8AeEXwnmAxVfLldWp8COevAcXcVWW1//koSUyVwA4m4s+TfPXU3i91g/TO5LIiT104w50Tun6z4WatSfkf3kXjPCJZAIrTS+ok1sw0XVYipFn6bBz6L3Nz5eNv/IXXzYo8hXxuvPLfXk779fhQeaYZ79rtltdD5Fu1EBNDOG0cpPcE978NTKj2IgLyarIVbCjVzXhx4ocQ0HpRX+XZ+PF522I7Fv1hXEVdtYNIy0Lymp7 y8AgTE72 3/6nsUZaGsUChembR5Ty8pYbJECY1hGfud2gs/AbIvKH6WrNh8Ur7jkyHxcEXDqJpNP7xzUUb1Lm3ZjeGVyCYXodmPdPxbYKdHtFndFDPzExfOwRKkMqNx0rYbQJiHGE568OWIkFPDKZnm0rPWRRSZXfnKGtYMHwFX+sWlJt+x9aSA0CwY2vjyY9HmHmI+3BF4M85YS8uv2Tp3Ptvy/49dC8/0vRB43b5A12VHvTccMWQ/cMOT98AvR56DyiYrxgbecEg X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Since commit 46df8e73a4a3 ("mm: free up PG_slab"), MF_MSG_SLAB becomes unused. Remove it. No functional change intended. Signed-off-by: Miaohe Lin --- include/linux/mm.h | 1 - include/ras/ras_event.h | 1 - mm/memory-failure.c | 1 - 3 files changed, 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 25b541974134..0bf0f22b32c8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4048,7 +4048,6 @@ enum mf_result { enum mf_action_page_type { MF_MSG_KERNEL, MF_MSG_KERNEL_HIGH_ORDER, - MF_MSG_SLAB, MF_MSG_DIFFERENT_COMPOUND, MF_MSG_HUGE, MF_MSG_FREE_HUGE, diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index cf7f19b7ce64..9bc707fe8819 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h @@ -356,7 +356,6 @@ TRACE_EVENT(aer_event, #define MF_PAGE_TYPE \ EM ( MF_MSG_KERNEL, "reserved kernel page" ) \ EM ( MF_MSG_KERNEL_HIGH_ORDER, "high-order kernel page" ) \ - EM ( MF_MSG_SLAB, "kernel slab page" ) \ EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \ EM ( MF_MSG_HUGE, "huge page" ) \ EM ( MF_MSG_FREE_HUGE, "free huge page" ) \ diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2e6038c73119..4b9a9298d478 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -911,7 +911,6 @@ static const char *action_name[] = { static const char * const action_page_types[] = { [MF_MSG_KERNEL] = "reserved kernel page", [MF_MSG_KERNEL_HIGH_ORDER] = "high-order kernel page", - [MF_MSG_SLAB] = "kernel slab page", [MF_MSG_DIFFERENT_COMPOUND] = "different compound page after locking", [MF_MSG_HUGE] = "huge page", [MF_MSG_FREE_HUGE] = "free huge page", From patchwork Wed Jun 12 07:18:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694532 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 D24E9C27C75 for ; Wed, 12 Jun 2024 07:22:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 887626B016D; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A0156B016C; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54EDA6B016A; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 317CA6B0169 for ; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DCD5F140F76 for ; Wed, 12 Jun 2024 07:22:26 +0000 (UTC) X-FDA: 82221393492.24.FAC74BE Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf26.hostedemail.com (Postfix) with ESMTP id 7B3CA14000E for ; Wed, 12 Jun 2024 07:22:24 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176944; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X2T5SjfSLlo3Fw+620ziHItY48mlr8d/xzkyNpMM/iY=; b=ygTHlyoFQrMDSOybuWMd1OBJGpxQC3I46ThKB9Jf2qDRqjnDyhyROTx5oKeJebOxtKMHLk MdJkaEF+m+nGjqU0zo/fHHOlWk6o5iuG2b7YrvXwZVck6nOwosS9Z24CLs1ntcalPB64l/ 5yh6RDY16RgoC0Bcaw9LwXVFyaBqj0o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176944; a=rsa-sha256; cv=none; b=pVm0xHKJvk4FzomMf+FpPgrRNhBsj7vECwMkD/LrZS7/u10QlBIB4OGhpe5iqVa0wivhYB 8QFOM/e2YZ4k5utwX1IT1ZdnfE+85scmnmVJI9FFRdT8MyMRJft52RlG+hgbDcPy2ccakr cVekWjYeKz4L1r5l+y+OAasWEnikNew= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VzcMW2kkSz1JCg2; Wed, 12 Jun 2024 15:18:15 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id D6827180AA6; Wed, 12 Jun 2024 15:22:20 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:20 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 03/13] mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM Date: Wed, 12 Jun 2024 15:18:25 +0800 Message-ID: <20240612071835.157004-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Stat-Signature: sp5a4nqhm3r4ehobhcqbyh4zx4r5fbjg X-Rspamd-Queue-Id: 7B3CA14000E X-Rspam-User: X-HE-Tag: 1718176944-954863 X-HE-Meta: U2FsdGVkX18sFnwU8v3LERt1dAJVTYBZqV9cNeYZ1LjbtWkrmawMGSpOoPizxOyKSR6uq9VGQVBLMeOhP/r8Nk9kYmHlM1d7LB6lKjvnua0WpRDKXTQbflVpLMlBmpfVkrQ1DMnsFzGIjeQS0+9P+oLNe4AmbyJSUQb5+iIhXQoApfK8tmpX3OLA6g25u1GFv0a8ZuhyT7ZNxHJOmb330rbYOjIwKzrya/CBxPt3mhzpuyuC35V+Y+BgcdnFHyYGP/SL3V7RmWDiX1YB/18aYcZmVnxCGl+OWIbc2FDPs5OZD0sTzLVoJnta8wTVV0aXP5biTQ4gotiwftJrhFlqJSOtzJ4Ae4jyeUvAeDhAn04DwmO+HQTGbBpzXJMjT3gC05NIf9LDXkKznueO0sJRTyZ5MQt9AfxmyaOapFUEyRI47iPVmlcY2g2HifFewEUqOWsEmr5Hl2BCFrqWyFuidjX2F9YMDc2gTHdTZ89KczJFf9yl0zUd9O8r0/u4+VVKaRtijxt0Nc/99BjDCzp8DcfeM9qblBBHzOyt6fLebiBEg+/0aLqIb/A91XX6TpD6IM9UQbw01AO7qjpufWYvkl9ogcYmYffm9x0fVzeMnD8gf3JkuBB6XVsBlFxcqueap6zcA/iTrdmh/EElZsyXOhM6PgBN03n5S26sCDDzsFNTYNCbRRFruhGU2DdPpxv4SQR11FLxuLDfgpslbPP8qa75bmDaxTxhjqCFqUsI4uX+0imqlTN+mrLnYbhdqnZ0hnN1RgM4iW76AjpFuTRntFrfUv4fue2xMgZeFVFWjP6lZi2Ls0B04pshuAqx3hhHaJvcyh/D6flIsrN6zig3y8lnsSkVylzyTNT8uIFKMGLm0lnm5c/lg2o+nC5PVoiDoUX0Vtgk+FxKYMebJq2bWQp8qMAqVSjsug/w2hlaGjn/cV09aj0gbYhlWcsKURO+c3JfwSloHzjDiP1iYg1 NMkkBFih //ECB06x69p3OCX9IdjcO7oXMwmDz34ADSiWB1Yrdhe45d7CnFSOsWFW3GAEXmCr53yMmvdS+fWTB0HkEd0NqJA8V4+r+tGAT8l2hPFRbjxJxloKEsga/jjRvC5ycqBm+SwIj5uTg3tvV2H/OZSGWuEsG3cWSrX4r80CMjdNJQGuy1s9KWH9jWyt1Kvta8eYwZtB0CCEZ0ugkdm1e+S2Oi5pBUbfWDLIklUJd551MiKSFEHlvvR/Ukoq5lSzXKTiqUTGauIOuQackQEs= 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: List-Subscribe: List-Unsubscribe: Add helper macro GET_PAGE_MAX_RETRY_NUM to replace magic number 3. No functional change intended. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4b9a9298d478..958b17a4b0f5 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1417,6 +1417,8 @@ static int __get_hwpoison_page(struct page *page, unsigned long flags) return 0; } +#define GET_PAGE_MAX_RETRY_NUM 3 + static int get_any_page(struct page *p, unsigned long flags) { int ret = 0, pass = 0; @@ -1431,12 +1433,12 @@ static int get_any_page(struct page *p, unsigned long flags) if (!ret) { if (page_count(p)) { /* We raced with an allocation, retry. */ - if (pass++ < 3) + if (pass++ < GET_PAGE_MAX_RETRY_NUM) goto try_again; ret = -EBUSY; } else if (!PageHuge(p) && !is_free_buddy_page(p)) { /* We raced with put_page, retry. */ - if (pass++ < 3) + if (pass++ < GET_PAGE_MAX_RETRY_NUM) goto try_again; ret = -EIO; } @@ -1462,7 +1464,7 @@ static int get_any_page(struct page *p, unsigned long flags) * A page we cannot handle. Check whether we can turn * it into something we can handle. */ - if (pass++ < 3) { + if (pass++ < GET_PAGE_MAX_RETRY_NUM) { put_page(p); shake_page(p); count_increased = false; From patchwork Wed Jun 12 07:18:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694534 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 BEC1CC27C77 for ; Wed, 12 Jun 2024 07:22:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DF686B016A; Wed, 12 Jun 2024 03:22:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECDC06B016C; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A230B6B016A; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5F55B6B0167 for ; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0B9DB1C0C37 for ; Wed, 12 Jun 2024 07:22:27 +0000 (UTC) X-FDA: 82221393534.13.796AA7E Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id ABF0B20002 for ; Wed, 12 Jun 2024 07:22:24 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176945; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t0PC1cXunOjv6Jlbpl3SUPtntDxG2hgV7i49asWRawE=; b=5721A9vZqABTh8oEdx+PDIZNm3Mo7a0sOlyNrjiBrrOtfbUD8fszGG+o9OwOnWUvlkB2u4 2aXX1PQuCCbEGWXc59jMYh0iLPc7vLBc+OE+WmNOgHhYx1/zH+esqqpyzwgOko70vj/Yqo qiqltXpKlfFjafn2NHuNDfQ+TiModJ4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176945; a=rsa-sha256; cv=none; b=uHTptEoyYhg6PYug4zzy1or63i/1+FP3GfpXjyxgRByWg3Afi15H0dvjfRVQdhOXWbwzWE L6auYlGUnJptFNFiRyK099JFD48L86/nD19a1DBF2xEfovnA9j6+X+J+l+tUqiSJoRPOOz 4ZH/mt3Jb7Gz63FolXGzTlOiVP0ojlE= Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VzcMY0rTgzxT29; Wed, 12 Jun 2024 15:18:17 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 64D9D140154; Wed, 12 Jun 2024 15:22:21 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:20 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 04/13] mm/memory-failure: save some page_folio() calls Date: Wed, 12 Jun 2024 15:18:26 +0800 Message-ID: <20240612071835.157004-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: ABF0B20002 X-Stat-Signature: oppaeeuz4i8zna7pn6cmntws9xoab17d X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1718176944-214227 X-HE-Meta: U2FsdGVkX18uwsUP4B2PruL5bmOiK1w9mQKt0k+ZJrZ5yZrgCKINCIj6+WAf+iVftEIgKQNxvj2cqZ6IMgmdQIrL5qQ5N0i8omOWHHqaaet1wvajZgXVIXfeYVM+3svozoE3fZW+wtBjTFHDcUHoUsoER3UgFOvqkCX1JZPp1Nz7zbJXx9i7NZVngBgQxVR60De84kQbC0z023W1W/ETNFREt/uK7qoeWJMtbQy7mXO122bJ9yvAujIcg1/vOYSAWsMDfZBdxdbFRKWUGpU0bf08zOkBShvdXSj+xr7x3zjO04StPTb3S/bQ+UgtBIP36lanjp2z20atMhhwdft4ss6kOPrEAQwOMxj6/2F3yb6AY/TJwDt6Vs8TdVNPiYdRRN8r+0//JAxBwJWBoGa4mzTivHmglMG4T8LjSgfMvthjjmVpoZXOCMgWVRWkxRq90fiUaAXLP0SPerOphgoeJYKYoMy+Q+XsavJxDExtMANaYcA7wh4uVLrYe6mhuk1PZND6y0NElAmB8CMD9wkLyDnMf9OzPZQuT1WkHoim5zWl0CfLq8UK/Priy5kApdfesvMBRMHWBG6s6BRPPJXCbgTpSsZmzlPM6zSbCiUtV3R5V9qbRt0uDi08A+sVgFwwwaX8fHGOL2tSVeVY02tDSzh0c3cdHvETTipNaYFevcnCuVwPioClKtt3EgpD0AchoAN+yR2bD2CbAXVow0VdTYrJDiIUvdc+epTFDPzjfz12OYC9kgIlORThwpmYORKwg/I6+cGDM0omFOf9yPb3wziVQ67Xrzo1W6jiL6noqp3ebIhjUuxwpNL26tFwWxCyxfu6+iKSS3iJCOpyk2bBtqFffgTXN6hh6olMS7qwwFVhIF9Uxu2zzjIfcCBm0omkPo4N9ARoPKRMB70ppn8KjWelR3M8mJzjywrqW+sQotTvVD04aL4RM1axkGDROd+vyFDcyvJcl9edVqrxr3l eSjf66ga Onah0lqXbycJQ4c8MVMu4ub4gMJswPhlBbLx/1J2JdjQYLxDc7q3nBjt+ZDDhScS5DC8Dxkvnj/DsVuSXNSfdf2n25s4dIwrCQnN2O/VEHTCC6Dl/CImjOeVsNURAPr3hmiaegYQSKJxbyevbaqrmWWqOTXxrPecR98b3ZA/tcwBGo1M+0IkX6Ej79qejDGLQZ7sDOj2KBzz9ousgCl9LX6oki6XdOgjlOwIrFiX7uujzjYJV2voHAcLXwmskRwmEM4dLSBgHje789GGcGcl/XIOB/u6K3tX1zE4b 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: List-Subscribe: List-Unsubscribe: Use local variable folio directly to save a page_folio() call. Also use folio_mapped() to save more page_folio() calls. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- mm/memory-failure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 958b17a4b0f5..470c570d779c 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1575,7 +1575,7 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p, * This check implies we don't kill processes if their pages * are in the swap cache early. Those are always late kills. */ - if (!page_mapped(p)) + if (!folio_mapped(folio)) return true; if (folio_test_swapcache(folio)) { @@ -1626,10 +1626,10 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p, try_to_unmap(folio, ttu); } - unmap_success = !page_mapped(p); + unmap_success = !folio_mapped(folio); if (!unmap_success) pr_err("%#lx: failed to unmap page (folio mapcount=%d)\n", - pfn, folio_mapcount(page_folio(p))); + pfn, folio_mapcount(folio)); /* * try_to_unmap() might put mlocked page in lru cache, so call From patchwork Wed Jun 12 07:18:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694533 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 365C5C27C53 for ; Wed, 12 Jun 2024 07:22:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C369F6B0169; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8EC46B016E; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 884376B016B; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 62D086B0169 for ; Wed, 12 Jun 2024 03:22:27 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 16C67813B8 for ; Wed, 12 Jun 2024 07:22:27 +0000 (UTC) X-FDA: 82221393534.10.2CB9A2E Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf01.hostedemail.com (Postfix) with ESMTP id B754640010 for ; Wed, 12 Jun 2024 07:22:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176945; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RTisLkZup//DVRehLl5hYwdXLY2nceSUG3D1pVWcj7c=; b=naLPrS+cBb34NvmDQyyMZk6pocG/91X6s+8nNZwJ+4n1Rq9KahZxLlYjPfNA5o1vru9n7R ED8Wf73rV19XjRUifJrvYEzJs6q8hzIgy1DZJNg3kLJzOzZsFgfzwoDjW8dfT6tVXgKxs+ ILMqNP/Dh6yrgru7eZiDo5/AWjWps4Q= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176945; a=rsa-sha256; cv=none; b=J7Pogt1OvkpKeXSb2LachBIw9I03huOElzlvpoTBFprMbRXp/bsmjliUX8F2fU0CMsjSrC vNv5RGsTwB0IejatigS1iHyiiOMmRE/9bhS/Menk/P7uGvlP3tWgmXMUZwyBBc2d7Zx643 fEN2Ovk6G8IN/Lf7i1qICHBfmstZvXw= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VzcMY4PWXzxT7y; Wed, 12 Jun 2024 15:18:17 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id DF0571402CA; Wed, 12 Jun 2024 15:22:21 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:21 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 05/13] mm/memory-failure: remove unneeded empty string Date: Wed, 12 Jun 2024 15:18:27 +0800 Message-ID: <20240612071835.157004-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: B754640010 X-Rspamd-Server: rspam10 X-Rspam-User: X-Stat-Signature: 4nau9rwrp8z135h8nrapmop147yrd5r6 X-HE-Tag: 1718176944-156164 X-HE-Meta: U2FsdGVkX1/j9S0TA0xoPobBFVeKGkEfcw8fJgIuXErq1VQ2ZP/vJUtk2EeIz4ZWNNqc3h7QhBMa2DRlWmGxTDpSLCSYTWsw1+Q4FiZ+xIgUKjrODDp2RQnxt7h9jsNNGy4m9mhHPZAYCBu6N/U9Bi1IelM7jWsRp8Trdz+ikrWLruTqZ78vmFwwy+fb+MFptcVlV375+O3DeJEw4kA/IfntFcjTCYVaA2YynaIx/VDC9Y8/fmHmJj5/JDjgN/tjVr8ZJgxFZETIdK7PE5uQ2k8WbQBafNfMsYmjnJxvooRnQvn+sqQEJ1IrzR+IVuGNKUCBNwXeJOY+NN4XRIiMNazcr40GyC6HAKBUKgTWQNo3QEcP59woEELcQwKTY0mJUZjdMP6wsN+iCONegxfPtSZwzRYFPx6SegKKbrGDuLz5hJsGkbUdTLenRq8+KG8/5y1/z4lCrVpdCTzovM5nw2cnz16xaP/Ary3i7XYTuDS4xSHDWNoBcPmo7XWMKU+reoqfhL2n6Qlg42LsC+wqeUdKnzZjRgxnqFazwMRQvEUJak75R1usKM64+Ak3xuvSRYQSX9YA3AT5M50NnS026M8Z6jEESx4TWVJ4Z3iEjorWDzEfILIhfPffeqqmcIpz06pNl6QwWb9v2oKIgEUH+HQSoCVApyUYOiARTe3JWjLbTUaPbP628cEsORuYE4+Xi0CshD63rb1Xe83AKzIkwn4uGdy6Z5YoPKpFK1DeidgKOuFa8YSY3M7rBxy8s2XVFjXNJGfasPl+Un3Lq1KktMC1NHzJSmGURcql40VBK/Y8bvHL43L07uExXGlohpkOehGrNpOKZeh6hXY7PwkneppeULqy5DBTnRsMR29Gg0A4FcrPHifJ+XmfR9uiL78TfEOGUwFv2KrJy+zj6Vey8wBuaF3oyKU9EKOzQV1WYTCJea1Bzww8JnwcACppZLWPDICsdGoPuLkn7hDR3t1 oHsSd1kY CWbR7C8/NGhmVuoIUZP55JMXOQEn/acEBhI66BNeIQiY8ef1JoGywoQhxoLdvW1ZJSrPVRWBt+nkyhFLE+9iIpwqH4DrgvViBL5W7X8bbuX438aXaO12oSlCxGcpwNXZDIFze7ktgKHkPJfcwvoCamt/d5cx+kq5iIL1lI88TVOTNTrwA9V5z6PQHQZKon0qFi+EFqRNBTvZs5DedqYVdRpT8Rg== 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: List-Subscribe: List-Unsubscribe: Remove unneeded empty string in definition of macro pr_fmt. No functional change intended. Signed-off-by: Miaohe Lin --- 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 470c570d779c..ec482524158e 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2518,7 +2518,7 @@ static int __init memory_failure_init(void) core_initcall(memory_failure_init); #undef pr_fmt -#define pr_fmt(fmt) "" fmt +#define pr_fmt(fmt) fmt #define unpoison_pr_info(fmt, pfn, rs) \ ({ \ if (__ratelimit(rs)) \ From patchwork Wed Jun 12 07:18:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694535 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 64D16C27C75 for ; Wed, 12 Jun 2024 07:22:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A337B6B016E; Wed, 12 Jun 2024 03:22:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BDAB6B0171; Wed, 12 Jun 2024 03:22:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80DB16B0172; Wed, 12 Jun 2024 03:22:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6015A6B016E for ; Wed, 12 Jun 2024 03:22:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1BEECA01FB for ; Wed, 12 Jun 2024 07:22:42 +0000 (UTC) X-FDA: 82221394164.19.1ECCA20 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf18.hostedemail.com (Postfix) with ESMTP id DCD101C0010 for ; Wed, 12 Jun 2024 07:22:39 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176960; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH2rm6YiNrNNYVCZu41szqctz2O14RfFm9t+tz4o6Bk=; b=xKSLL1tQngO7othw1aUYOCDAO+3RSBJ19SOIqYBEaJUV77RNcAvHUhUdUb/4YxcNG/pbqB h4naesPIJ1h71/zWpcMeeZm57aVU1I+mHkHC3tenBAj+gO6AOIbppRE1W404ByYI4p5aEm abm+YnTcrmuf885qP7+UM+l2OZ4qaG0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176960; a=rsa-sha256; cv=none; b=DZ9k9cUEYhjZj14UxKMu1DHNnsu7tSPsauZgDgTQs2htw2QBdjc6Npg/9X/9KyW84E78oM 5v/YckDuUsHEtvXS3mTKMjE+2H/P5Fyhoxk71qVTJmx2wEIHV0tiallTkEsiGFdAwvKfZC 04dreB7cDCTPWMus717atkVgbPYm8/I= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VzcMq6SsNz1JChd; Wed, 12 Jun 2024 15:18:31 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 664BB180AA6; Wed, 12 Jun 2024 15:22:22 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:21 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 06/13] mm/memory-failure: remove confusing initialization to count Date: Wed, 12 Jun 2024 15:18:28 +0800 Message-ID: <20240612071835.157004-7-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Queue-Id: DCD101C0010 X-Rspamd-Server: rspam01 X-Stat-Signature: mt53p73b9fz5zk6xrm56fbw4tcr54k8i X-HE-Tag: 1718176959-21998 X-HE-Meta: U2FsdGVkX1+MJmodcsRizteHeHP/vo3HXj8AIeGWk4RDM3/nhacdV+AU+9eqZm4j9pUHU/kvVbnDulxybaC62rIcPnBqOjX30NaG5U7ZSUgqCCOm6LPGLqWNCfrk3yztpynrEBknJKO+HOPLI6goxpAIGLUYXRmZaZ1dlEmmIwQb6bLLn5SWHanZhQA6/67u//f3xfaWwKbCA0JnkJ09PIpxWi2kUejKjs0BXSBncbMUF8WYo0p2te080DdjmoLAW+zqEXJSa5YX7bnZnxWeoXNWmPK07gS2XFMNfdoodoJRdLT+W5+wMQWrzqaMSYjOVDNnx/rmlRHgnWrDJUVkA/ssj37B/P40HoOdYsEjwuoJ2gH/Wm7m1JWKDt2MsJUx20LVFtMFnObzwR74yMSOyrNmWBKM1a1AQZmb2fKDdGKImq3gU7yhiJm795ekWEXFzlnZGoD9KKbjKkG9l/pC8N6109uk6gWeI0lDCCIsVYpIWa97iXxSvOWCaQG0oC8CrN6CNhjwzgg6nHHlr08xhkBc8M70N7xEUWjmp6j3kc8TU6YQgAjyJkDN/9PJt5ClUGcu6BL/i9izZv8rMP8uWI0Ph7Ifww3xdZ+DmSimqqf4cEZRNQnZ0E7k0eixfQ12mmeVaIurbh4KEPu0St/rB0cur9eEg0S226kqBNmBiZ/3u8QT5GDPDwMa4czxZoFsjiv4GrhVB44SbnkZGRn5bSU3/1LS8U+zuRfE8CRgf8z14FYiyGYkktTJQwqsD0E1Af1MULM+veE3DwwZ+SpP5mDyc3tqraFW0C9smQDOwZr7i+NsDWpIpTSDchqEfIzlmP/iexgQa50IF/uOH+i0EYterLFVrtve/tMKNo3fTIYKfHZKAsc3b33fG6oTYo77gyDoxwB0eK8hWjh35ZUHR9ouhHVOfy9YYO81l8fO6EYWzoHhMM9c54ZSaYm4D0hnBZ+5oPpfGhaPbPFpmfE BZc8BRnz YXa9UMvP/oa4qYMa1EO2iAmik50g3u3t9AJP0nTEGUbNEsEVzJjD0JZHpNQzZAdbnEAd59nztLI2HBw6BxaDWj6jcRi8Uew8sI4OD5T549lsa9NRx/vEai2/dCT+1q8tjPyZSU8d3+xMln4Mf7XiGHCHGjEJksxBAjKlwbB5NrWjvLDfAgaweCNzuUPJImzoMldctMA+zSAZFGKEhGutjFzKtpQ== 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: List-Subscribe: List-Unsubscribe: It's meaningless and confusing to init local variable count to 1. Remove it. No functional change intended. Signed-off-by: Miaohe Lin --- 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 ec482524158e..339752d768d8 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2542,7 +2542,7 @@ int unpoison_memory(unsigned long pfn) struct folio *folio; struct page *p; int ret = -EBUSY, ghp; - unsigned long count = 1; + unsigned long count; bool huge = false; static DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); From patchwork Wed Jun 12 07:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694541 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 D9D76C27C75 for ; Wed, 12 Jun 2024 07:23:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60C996B0171; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 275216B017B; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB3E96B0177; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3AAA66B0175 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E1D0F1C266C for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.15.B406F4B Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf28.hostedemail.com (Postfix) with ESMTP id C059BC001F for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K9Q34p9QZOx0uj8OtA+JSRwyKGLRGjzKgQRifHgwL8o=; b=DA5NLDEFuUlEo+5nQwBgLCzP7IeFVc13gq8tQtO/tEribEWCAiWeZn0nPFnGLXHp1eCrIR cjWCJiLN1QXbPZlO/oLRSClCOvjYmY4ridhD7SB+22fxakdzEN43bBAVksPWl1u5wN/T42 /oTUfwSDwyvww2lp2H/9hsQfAbeD95M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=Up9VzH83lT2s7cv2Vo9d7Z5MsWJGaTQDB+TrUPE5g0F2IvzPJwKIRQuSXcFPu9GZT9Ouui htxo0eTnaGvbC5WbRPMyueO6rN0+bts6VY7v71vN8q4eIMhrscQoK6u+F8Iz2glzlGjK80 EgIwpy70LOagzNzKZuK+2eCRArnm0Zo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VzcN66mtsz1JCn9; Wed, 12 Jun 2024 15:18:46 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 69F36180A9C; Wed, 12 Jun 2024 15:22:37 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:22 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 07/13] mm/memory-failure: don't export hwpoison_filter() when !CONFIG_HWPOISON_INJECT Date: Wed, 12 Jun 2024 15:18:29 +0800 Message-ID: <20240612071835.157004-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: homnns3erb8heimjw5iazm4now4dbifk X-Rspamd-Queue-Id: C059BC001F X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718176975-410388 X-HE-Meta: U2FsdGVkX1/9bI+MrLWm7XC+K+ZBJVuMApZY6E/oovFH2W68cf5jKyW4HqErS51wPp0tc6Z0LUaJDYieFZHBDDPxfSfDZi38ra11g36U25613iA1rQXErFayByJQ2eotfcYDd6uXYH3C8Huceu5XQBqkBiSNLwDxu8uF1Rlms66ksxFrpkUfELe47nnne1hVLblml20ghRFGssNNg707sVaWEokPv3oG2pGO5WoQydzsFte5pRhhje67gcNW4Mf291UxkwKcsGlo2GmC6p5T6RWae9D/R5bL/IekO4VCnz4gIziqfbBVp5uGT/Uv1s1Vzl3mMrTn4sCQNG5X8zi8jwcWtjMCZgma8U004C2O5H0uSc6mvAG5/5huvUl8DmrIBsTBE5gEs1X+qIDNalQXm8pcocwsnDNhEloNW2t67zyj3983Ls/uenuPSO6sTNXBDfDpwg9MSx+ZVmSwg7P9QovBV+VlyNjSObTCM5tCmgkuWGJxamgjYGUFdVQ476IlgGddmuEuxgwTXXzPciYRXg6c2sQ9HoFlg47wcesw5LrM8ScDGi39vAnfRspflWjId1NI8b8G6g0l69nJX3VgXNtiSQTvIltAPIlEnvxnI5whNHmUBkPtvF37t+NxAVE3Gi5bHj1nYCmCR6HgT2RuIqHxk37sy4S5+UfEAumQmM5Cb1+cB4VG+522bzrVVD//6l1yBgr/j/a/WIH8gKdbyAe/pZXEEY+9eAseaMZf/tMN0yT6UgZJem50xp/NmcWF84qTuU65KU504vhaXhDxL9yYulyJb7om7EWfZKV6ipFw2YQmac5GGp4owAyMLyn2MFSNcjLSYxmoCAjOB0LNyviccfZ1LbaSO9QfhHciToBtGho2DG09awaNTSh5G34kMHSU1bjggZbloR7/0abBWo5m8o6gm23rIb9WtihuXTeYc1sDP7RnJCrhBXg01C5/afp7l4ALMhGOH3oGpsO 6mYrI5YQ 6cIUmAIF0lt4rUzR2b/JvmPruayvGdINBz28j/prRS+nfzWX744XXGsSUyK2eNTiwuslRztLG60FacD1j3xPDhzzZ+dodmdyDNw00S4f7mYORcBEeoL25v7U1WwXUrSDkXHtBVtEQNoiC4NSPal1FxlWWLCHCnYfqzcOIMx3GebxnJuuwRZCOyV9Joguzhi+pabnZg4zyBwzg0kcbiPUdrHgvEBCr2ZHKQNK0wxxoW3Un4kQ16OWJuJ+zZ7xcIMkuesmwLvlsu8tcWRLGgwYNS0lcZc21sj9wcO+kgGAnB21D4J4aP5YZxvg1MzLU49U88XoFAG8NyIhvoZQf/hIQ2kzZ4UsDBaZL/Sqj7CenkJtV7RvYH/Q3g72IeU/co/SSBxbT 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: List-Subscribe: List-Unsubscribe: When CONFIG_HWPOISON_INJECT is not enabled, there is no user of the hwpoison_filter() outside memory-failure. So there is no need to export it in that case. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406070136.hGQwVbsv-lkp@intel.com/ Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 339752d768d8..ee6ec63534b7 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -294,6 +294,7 @@ int hwpoison_filter(struct page *p) return 0; } +EXPORT_SYMBOL_GPL(hwpoison_filter); #else int hwpoison_filter(struct page *p) { @@ -301,8 +302,6 @@ int hwpoison_filter(struct page *p) } #endif -EXPORT_SYMBOL_GPL(hwpoison_filter); - /* * Kill all processes that have a poisoned page mapped and then isolate * the page. From patchwork Wed Jun 12 07:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694540 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 C8823C27C53 for ; Wed, 12 Jun 2024 07:23:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 302786B0176; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E51B06B0179; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B449D6B0171; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1AF9D6B0177 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9CA75C11AA for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.07.8DC1C88 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf09.hostedemail.com (Postfix) with ESMTP id 68AFE14000C for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176975; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SIwq/rG4ODoyJgdTmwJvBbiQWYDyX7Yl/OurV7A99WM=; b=uhmpEpZ6KuhFm1wQqYtXRygmGUW3Lw28vU1oSGnb3sJG1CIxOC7XoXKyHOHoGbCv82QDZ5 8wTuJ59LKfGPkPyYvIe3kMjj23T+7GKyYiKoCpyq7E3bj4gSErMezkKdtRAllDK29AJ70I RqVpeqJ39Mbl42BOwtsobpSA6qTGtIM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176975; a=rsa-sha256; cv=none; b=YuT8B9PgDs143ehrqJJj1XzyhTvUWLWNnyUI8ZsjgPIbzTo5Q9ClvDJVhi/LpNhCvw5yYg 0jq+xcPUFt9mrWnURVneIxCA/0IYflXct1tghrfvmQQ2wj/kibYMLBahN4l0DW+Abil2pm etSouWSok5fUzfTYDxoilZAOekYd2VA= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcMN65pyzmb4P; Wed, 12 Jun 2024 15:18:08 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 7399D180AAB; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:22 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Wed, 12 Jun 2024 15:18:30 +0800 Message-ID: <20240612071835.157004-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Stat-Signature: 1mc8aydybz8gp7yt7odch5w6cj6am39n X-Rspamd-Queue-Id: 68AFE14000C X-Rspam-User: X-HE-Tag: 1718176975-697815 X-HE-Meta: U2FsdGVkX1+gZd8b/WyJgXxkQzn+GfFQe46J959NxVnTNdY8W9THwAVaZ8r62DDmfYmUwNamQSdWfnDpLp+GeHCJs+CYUBkfYFGdh7s77Ahdt1iCUGDLkVEyzIFUBzQfNNZNHrZDKARkD8urcz390CTpYbtybXwqSNTGJO+3UzaYOY3yySlUQzpVVsjRS6XH2AxVysVUn+mIpoCa9ExG/X1SqsIIhXTY5oHZBz5B1kgn8nf4OceqHe+rY0zSY0UtQDsF6Pmlu3S3iHaOZcejd5nTsO3/fKVs5r1aAhLbXbFIUbrcoErHie55v7iYPPAufSunbh5ZCOzjJVY+Vh0HhARj0U8mpEzdB83y5sQFltNZSDiEFrg3nLzd4EtEigHYbn3AGhPOlYSF4TjLrU1e2cXaPANL1y6B48GfZcfRJbTDv9Snk7a+GrGpN5DQYUpF9aRzOvSTWisFGHe73F5pGnhDu2HORdtIPBb6Dpg8OVB0uAYcOHD9xz9wqNND0Urn9+20mX+yYyy4ldxgfgKGhoRBaX6F/UXTfMUpdikl5Ll4tmcWqEnBuQmR+BXUSnVovrPo2pg9EUhoY6yZXT8SAu/t2K5FE1pV90/l0CSX7p/8YtAuGLM0rpOnyaDFEg/w+jC0tKzpwmovn/q2RcpGe+z6/+2bpftdw7qEfTXOMxFQa9OvcwpYEgJLQxvgyhYDBwniAnh1mRQdcYf8rpejixb6ZasZDQ6YuEiyx8NUZy51HPrHBTwcjPbEPshbejUrlp/uzYtp7+fHAzXt9fEOqcr/9ZvULJ9rI2AdHzak1H2D8IUY6cBuofO0W7/jM5O5ifT2jzu03YnKlrdOpiNssG+WGm0MiwnMB5g7jn6zyXZ0RCIB4EPxqh2aHn/2lr9fF830cohJtaG0zSZBK3cm3ZbuAApJ8MopGcJvvZruXbloZlegskHDa6+OeCr91Jn3pqNRT5C7C+IQFlyv1Xa RHD3/7YA zC+6vueI4Stc/OL2cebt6HFRiPkT2fZdZGyr2xd/ej1mfXN8Fmpz9cQW4anKyl6zNOfAiQidGXR+Ktie2EPn10EsierobvyGa3cCLGmgEeu78IIGcqTc0nkv1LxvJuhc6UAwZ2DWBHHJAdVBfe4QgL2QxeH9H3DKITZUFPoZC9I04aU+EKAqD28BA2aGF2X6O5qxBYR95gY3iI2wZV6CZSPyYVpfpyhIM4LFHwGyTptcgp25/UcrWbn8KG6q+NiP+GiTRulvrQCX4im3kJNmjic7ZLwTWqbwbS9Ikjd7u0+A5Lbo= 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: List-Subscribe: List-Unsubscribe: Use helper macro task_pid_nr() to get the pid of a task. No functional change intended. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ee6ec63534b7..bd3ab367ba2f 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -343,7 +343,7 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) int ret = 0; pr_err("%#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n", - pfn, t->comm, t->pid); + pfn, t->comm, task_pid_nr(t)); if ((flags & MF_ACTION_REQUIRED) && (t == current)) ret = force_sig_mceerr(BUS_MCEERR_AR, @@ -361,7 +361,7 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) addr_lsb, t); if (ret < 0) pr_info("Error sending signal to %s:%d: %d\n", - t->comm, t->pid, ret); + t->comm, task_pid_nr(t), ret); return ret; } @@ -523,7 +523,7 @@ static void kill_procs(struct list_head *to_kill, int forcekill, if (forcekill) { if (tk->addr == -EFAULT) { pr_err("%#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n", - pfn, tk->tsk->comm, tk->tsk->pid); + pfn, tk->tsk->comm, task_pid_nr(tk->tsk)); do_send_sig_info(SIGKILL, SEND_SIG_PRIV, tk->tsk, PIDTYPE_PID); } @@ -536,7 +536,7 @@ static void kill_procs(struct list_head *to_kill, int forcekill, */ else if (kill_proc(tk, pfn, flags) < 0) pr_err("%#lx: Cannot send advisory machine check signal to %s:%d\n", - pfn, tk->tsk->comm, tk->tsk->pid); + pfn, tk->tsk->comm, task_pid_nr(tk->tsk)); } list_del(&tk->nd); put_task_struct(tk->tsk); From patchwork Wed Jun 12 07:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694537 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 F2B6AC27C53 for ; Wed, 12 Jun 2024 07:22:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 886626B0173; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 835996B0171; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EF9E6B0173; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1A1576B0176 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D2CF8A1311 for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.25.6E50A89 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id AC355A0008 for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6/SHcDXQmxSpVqTpcobBjGNnzV6AdTQaqbwaxqEL69Y=; b=kd0gQ2GfkuIuLCNZSCUilQFusYV/OEeDqB/S6VKgyaSseSh96pNRYqqj8yNVYTJv6xnaP6 lPj5A9BNpF4Funcy1JQ3ctgbz8t+cW4WCSVGzTxTrwyyDIIca4LNh0RUpheiGdUi0rikik 51VXGAFlzofYXn7K1q458HpJKosgoZY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=0bGN3UYacL38qJauJ1VDg5RmlIdG0mlRzuqKQG7R/OZkNCQelu8qgAMEma01EmAbLdCTAL OJXi/qqvU75gc3nObeZvqOC6lKtLlxSyhn7+tobjfPyfBMpTKMisYOGr9Ez0UsbYNANyvp 3R8BL3ebyqpXodXKrVEyJErbvNvhKgg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcR91Vjfzdfth; Wed, 12 Jun 2024 15:21:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 7C8D7180AAE; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:23 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 09/13] mm/memory-failure: remove obsolete comment in unpoison_memory() Date: Wed, 12 Jun 2024 15:18:31 +0800 Message-ID: <20240612071835.157004-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Stat-Signature: 1179kk3sauuznxrewp64f7pjptfgf88u X-Rspamd-Queue-Id: AC355A0008 X-Rspam-User: X-HE-Tag: 1718176975-703233 X-HE-Meta: U2FsdGVkX19q6wZbImvz3wdK+XloOw8FuEfR/wpgz6GkU7vfEwLmdEo2bIyAYkTxd9a27gsl/tittfzw+VGkrBVqW1TOP+9FtrSl4w7U6utZBJIbHzIcIX2zDKVyCNWmM/LAqpy193sHHM+pa0coSdIWhwX3qJAMZm6HjUH7UVWqog8jLCu6unXlI0arJ64Yq50wuXz3Vf2io4H2cEhu5N25BXx3M9lPcMTr5sEau3i8OcldQxB6vlxKGL4HCYYHar0tK+VG0GfWjhR5oi4UkLvqrrSG9apJS5WvNdjjZk3v40ONyHr10+0nGOPFz1PY7NJU0f76h06vx8p14LMZKQIYL0YeM0oxpz/sDnvfs49yGpBvSkCP4Ul1fasRhefc/0lt++zhdpIzpL6pQMvHkCfnTNa9XOZArqaWTfJ5bqKXtqX6vhzbLafwUUuGCqOx7ZL63DhRq9TSPAxnyAYD2I/bXc53oPuuDcdRErbkz+82/JNxDRoXtM+4H6MxnlK2OKSbL9a4fXIhmLalkuZj4VMafSdj2xIO9Dpc2BtxEINHdp4/iCP0TEAYN5CymEP8xwnakxKYIg3TQ+Ycmx6ixr8C3n7NUNMfZC2f//H5Nr75WYG1eUaxrWTpg3S2gBlN0HXvR/G0NPtDzbE6I4JaA3kyMjQUC45qC8ZuS0DObQy+47cSG5AbKpPXBzXm7PKjs3czEjkIw142xLnWftNlSBCmItucLrLA5VTuujuPZONT3HeyveFUfF6KyTdxlLMm1WVFADl7v8zS/2Otpi1nYSjVIf4cGNzvveD0+Y1nLLAx52VfaL0GPfNT4JVQrnr9goX8M2TeiZSKH6Cemu2FE4UQjd2hNqykZfAxnBGXNYqU7D4kbTEgoNnKcNwjP+FFbverqdOlTbncRKarTtAnZrcHr3jBMfYdcQuN0eqMfEJB+bQFPbaYAGb3jDACfCdepDsyy80wY+I66o3mNG6 OYmcMwYB cYter66wPxM8clmjjvK17huN1EUeO62tXRacbfd6ca6tI98FJlZ4Z7u5YFgsibOYxugK1zKAekKafF/KUY5J2x83EIRC5fjOuxEHSUChhcLn+7WloA+BKKwnHb3aAs+QpY5zZhQzxawLbLASgecLUm/djOvv8DfiYgToO/q3HkcGBvSdggjjfQZneHknnT+4MGRYdXo/pwbC4ofyrf5MW9eJUN3yEz7xSlv2s1hJ7mFJGi1ES4FA0bsalolh4KciSekrD2OcGzzL+G1ByXqtKoBaQ8DtZNmq6i4IF 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: List-Subscribe: List-Unsubscribe: Since commit 130d4df57390 ("mm/sl[au]b: rearrange struct slab fields to allow larger rcu_head"), folio->_mapcount is not overloaded with SLAB. Update corresponding comment. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- mm/memory-failure.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index bd3ab367ba2f..bb8e79381c1f 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2584,10 +2584,6 @@ int unpoison_memory(unsigned long pfn) folio_test_reserved(folio) || folio_test_offline(folio)) goto unlock_mutex; - /* - * Note that folio->_mapcount is overloaded in SLAB, so the simple test - * in folio_mapped() has to be done after folio_test_slab() is checked. - */ if (folio_mapped(folio)) { unpoison_pr_info("Unpoison: Someone maps the hwpoison page %#lx\n", pfn, &unpoison_rs); From patchwork Wed Jun 12 07:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694542 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 F3FEDC27C77 for ; Wed, 12 Jun 2024 07:23:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 896B66B0177; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43ED96B0178; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01FDA6B0171; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 627F86B0176 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 17956C11E0 for ; Wed, 12 Jun 2024 07:22:58 +0000 (UTC) X-FDA: 82221394836.03.5A94A15 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id AC7C940019 for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8W/uCjh36hzTQNkhRo0Bf6FnikE7m/wx9QRTag7+des=; b=sh5lRUZT4wIYTp3gS1251n7+LXFsjtUTSFpQfAaMT4DVG5zREC7mFpE6n5+EdRaxG/oENw JdEBpocEs9ZcohMDJn5SHFbt1UNlRFuF3KzdDZSpH/1eskn6t7ROsp4B0BkenQb1LBM+Ji uAT3MqN1xGMttNR9oqFX7FbhkeNAg8U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=yHI79BmJafak8oybXOWi4wNr7kcOeFbO2VwSCFqQMo8qhyrYQ+PAfKOCgSom3/Du7Bqnf8 ZuOQvVfT/GnHwvgWrfJOV79c0Ph5tpdzqx3/BxJnykAWN4IMLBT5r9zxgT9qrbzpLsHXfA U73O39rTg8TG2+5lYWGAjWB/UR0p8sQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcR91fP6zdfqZ; Wed, 12 Jun 2024 15:21:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 84D26180AA6; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:23 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 10/13] mm/memory-failure: move some function declarations into internal.h Date: Wed, 12 Jun 2024 15:18:32 +0800 Message-ID: <20240612071835.157004-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: uzwiw4xyn93hxc4qq1da8eufaxntsa8c X-Rspamd-Queue-Id: AC7C940019 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718176975-901203 X-HE-Meta: U2FsdGVkX1+weVInBiPAU4VupL9sAmHMtl4eOyWkEwhVkVOkI4NIBKNQKqrOD4X5Ga0/nMmFhe8GRnrSJE7u15gcq7nO2B5ya4DEp9h4oCoNiLYIZF7rQmL/L9TkHMnu+gcLLmvaUcqT/DZaR7ByAXMLRhNSGqab8dKLBe1x+zBtX04ZGYvjcw25iWXiADVi6cmZ6Jh1+NLD/fCYfd8EcMZOtwX0Qhkoiq22Sm4k5du1I57WNxTjdHOZL3xjekn5oL9aZAChK+n9lneiuhGg+Vn8V0TKd5PCuhgKrQE0MxMKmgZRDUedvwsWIZ4Da/cMgeTinw+xMWGYHzH/adSomvsBk4G9KLlvEphkssT54YYJDAO8/7HoAYUmeC0Nhfg0MZGO11jZcxpsXLrr/T7oadLiCGfYGYXXtJOzBSoMJpJSjhNxT/znFYio9FmX8G3drThAJZHG+fSTlL48VhZv2KcVC8i9eKftxTE+OYbFRJ8nsuwCxJTHYOPEi+Z1FfaTHyn012kXp0lcQVGReLWt66IJilQtT4sPI3h/tLJQ+jFaD6ZAfx1EHC9VKCTKIJ9MOQrcaj7jIySEsV9Y4NjoWz/BJXHpx8ZTe8PTM0F8PWE+9DtCKzYt1+xrdcBNHNH4NRqlimOM9GJT4vHr/80sK+mzM1m+zF/7uKh71UpSfNTuCRff+beZgDBO90GLxjlM0ccsEhnpgf4IDFgmSLqwOAovyK8VYzYfeFgrYkn4sxxxfX6dp5TjVSAwAkNJZxAb/ZZajAVDl7TzZvGG6xa/zkweJGqysEhS6gr+If5tr6Ux+E/5YPCpCjVux3eIkNTDaetfqOCUdCO5GJW5vn8Ka5dipDkaaNrH9jZEUSLQShTZfLsabqVgXpBoUhAV/Xtomg5cwhfQ2+pfQbV92X6RM0jxxwL5dJCmT39zfIwKAthT5NaF1t2gAH3rd74Wgy3s/SADrsv7maP+iAnpbcL P0BDP4/Q FCKXflfJ1LPQe9RY/zeLHSXd/0OzX7gmj0EYx2Sc8LeOZIn2u7oafuQMovzZJxdr7lrwdVfPuzsQ5wKOIVa2NDyJcfXd1ETkpctNPEsl3qZyD8iNgDx+4kf8BqYAMRI26pOb9DN3prkBIhAMeqlndB4hEwsZxN5ld+rImWmdykHGrFk5YeZa29Fu1CWh0GC+GoI1J1boyW9RY9JfVtcEWe+TrmnzFVO2HUj8NUN4wRemsI2z/qA9RU+8Dul/g6v33JtJUhLJNdvmr9shTF94+JnWnmt0q7BI5OYn9lh6irUkz+qw= 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: List-Subscribe: List-Unsubscribe: There are some functions only used inside mm. Move them into internal.h. No functional change intended. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405251049.hxjwX7zO-lkp@intel.com/ Signed-off-by: Miaohe Lin --- include/linux/mm.h | 7 ------- include/linux/page-flags.h | 5 ----- include/linux/rmap.h | 2 -- mm/internal.h | 10 ++++++++++ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0bf0f22b32c8..587d34879865 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3981,7 +3981,6 @@ extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); void num_poisoned_pages_inc(unsigned long pfn); void num_poisoned_pages_sub(unsigned long pfn, long i); -struct task_struct *task_early_kill(struct task_struct *tsk, int force_early); #else static inline void memory_failure_queue(unsigned long pfn, int flags) { @@ -4002,12 +4001,6 @@ static inline void num_poisoned_pages_sub(unsigned long pfn, long i) } #endif -#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_KSM) -void add_to_kill_ksm(struct task_struct *tsk, struct page *p, - struct vm_area_struct *vma, struct list_head *to_kill, - unsigned long ksm_addr); -#endif - #if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_MEMORY_HOTPLUG) extern void memblk_nr_poison_inc(unsigned long pfn); extern void memblk_nr_poison_sub(unsigned long pfn, long i); diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0c9fd5250687..9a98b657ba07 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -611,11 +611,6 @@ PAGEFLAG_FALSE(Uncached, uncached) PAGEFLAG(HWPoison, hwpoison, PF_ANY) TESTSCFLAG(HWPoison, hwpoison, PF_ANY) #define __PG_HWPOISON (1UL << PG_hwpoison) -#define MAGIC_HWPOISON 0x48575053U /* HWPS */ -extern void SetPageHWPoisonTakenOff(struct page *page); -extern void ClearPageHWPoisonTakenOff(struct page *page); -extern bool take_page_off_buddy(struct page *page); -extern bool put_page_back_buddy(struct page *page); #else PAGEFLAG_FALSE(HWPoison, hwpoison) #define __PG_HWPOISON 0 diff --git a/include/linux/rmap.h b/include/linux/rmap.h index cae38a2a643d..b1bbe237ea4c 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -745,8 +745,6 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff, void remove_migration_ptes(struct folio *src, struct folio *dst, bool locked); -unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); - /* * rmap_walk_control: To control rmap traversing for specific needs * diff --git a/mm/internal.h b/mm/internal.h index 14bab8a41baf..c9dc056a47a3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1078,6 +1078,16 @@ extern u64 hwpoison_filter_flags_mask; extern u64 hwpoison_filter_flags_value; extern u64 hwpoison_filter_memcg; extern u32 hwpoison_filter_enable; +#define MAGIC_HWPOISON 0x48575053U /* HWPS */ +void SetPageHWPoisonTakenOff(struct page *page); +void ClearPageHWPoisonTakenOff(struct page *page); +bool take_page_off_buddy(struct page *page); +bool put_page_back_buddy(struct page *page); +struct task_struct *task_early_kill(struct task_struct *tsk, int force_early); +void add_to_kill_ksm(struct task_struct *tsk, struct page *p, + struct vm_area_struct *vma, struct list_head *to_kill, + unsigned long ksm_addr); +unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long, From patchwork Wed Jun 12 07:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694536 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 B6B85C27C75 for ; Wed, 12 Jun 2024 07:22:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F1DC6B017A; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 32D3D6B0178; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17D696B0175; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E0F606B0171 for ; Wed, 12 Jun 2024 03:22:57 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 99E911C0C37 for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.10.DDFD75A Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 7D82B40016 for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176975; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=01LrwiT8pxaCH9fLqlWEyOZ93Gkk/zNZK/bpe0t6A8Q=; b=mlRrPcEFlczHXuaDLKRL89uVwGZ/O+PmE8XVcQk0mTpsZmtEZaKZrtX5bWaIdKTjb58Enb cob7yr53HrvyKrGp1nX2h1eI01AiKoWNI8M+lJyxaWa+u6T/YtIhELIpioBQbPEKoT6pcZ +yXFdX/DVC56oaKtOGUCX5MFKBjBnns= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176975; a=rsa-sha256; cv=none; b=8AFaKm1y/AeEWR8vRhk9c6Hp0LnFWO+T/wX4J4hXl8VDKBx13Xw5e5XQeA73Qn1WfkUqk4 vncOiec3+uM+bmdz+EN9jV7S+/mio9sYXqE1tOQaIRk9lo8CCebJ30Yqg/1mLJ2hKiVqwH bqAh+EidoToGulaWbOkndu/Qunwv6Rk= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcR920tHzdfyD; Wed, 12 Jun 2024 15:21:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 8FBAC180AAB; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:24 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 11/13] mm/memory-failure: fix comment of get_hwpoison_page() Date: Wed, 12 Jun 2024 15:18:33 +0800 Message-ID: <20240612071835.157004-12-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7D82B40016 X-Stat-Signature: 8q3b94hnc36x17zjy4ektz38zu6g1r4y X-HE-Tag: 1718176975-227092 X-HE-Meta: U2FsdGVkX1/b0Q6QtqqfDLYqRy6LysCVP37yFmkB55EyBsm/SaLnRWQhrrvG9MDdmRqv+VM9fQikBvZqZhfm+MIScpQWNXfJSqMDnqPSuqj/IJVBKQUAzLQbE6LM3XaB2xK59IVOaw4t6MnmdTCGTEnhVNFYh1gcGgeYuM1ntzO0gEGcmQFol2/woSd2D5GMupR+xR5Tsrbp7/aiUc+TFhDUIOr0ifYhidUT+im8kscNBWiurJJECYtmp7c58r0lNt8PyvlPGitOGd6PH4L5V8ZoGv0l4gSHB9uM8auJWNBww8RkMM1Xztuuktb2QiNDgJkYkkMuKntmdqH/RiHIhrudAxMGdBRtJyVs+55ByRTCDa1WjCbd4yDfaKIe9Q5VQbv29oNMMyp23YIIEIW/zWRoH08CwnQ8+8ARhU0W0tHQHU0MPeAh5207xZRcSRW5pnmOSIaIyyIC3A6CcQBz1LsKRWs6dHXqk7j4iwhHgqHO9RzYDYnbKyqQ2Zw9RHBIIIl3huCx9CnzPfqxiuMORaJf0+/Nj7LAMzs2trr840kFez4B81xFPu2n4UPRdHnKhdZZFL+10K8tBbzNYjos0peolIng+SMng887UWZJQIbUAmuqPp/kK9hj0K3OlevOAssVu3GNOiGoadJmyAAsLZENMq4UKihaFU0wvFr/xR34WN9QwXVqQ6ifopDM7qChFx6W5n/40yWvZcpivtV8lFxWXjS6+2+rRgtpRFumsH69eUF/jfzDfaknvoPOqOQIYDzHCb+InjYGGNR+tj0wyZ2xECRtVT4Kix2A4Kwt2Grph7xXAfq4MZ531GJzFAeGPnw7PxOAD0d2MkJJ2nMZXh0yHib2Op+X8zKzlFuQKN/xc39PG2AlFYdlt7n8FGL9i6kXriAAYxifgMDKqFSx4b1d7yQYdfwESAze33CCgTNl8iw2PoKPamoRFn/I4yW65/vnoqnZSWEOPzF96ER bjrYtXnE dx7Emx9Xc+npjw5oLfopprTRmnKxxss57xzDGJJv7rRTXhSckOwjfKq/qd0jGqIGcrVnVP5/ZxA2lG3TLOfDs2dQCMJulyHhzF/Unr6MwxDun4LDCxz34NTPUBRp/xWvHeErLkb/P2ehxkP2Rc2cvCgXFipVWecQAdB/vIET44lT5xYspYmCpSrn0RO7suPA/anA0qLt5ErXiiira0RpIF3lugFmd80bgkj0qAgxi6xoyQp0i/AcjTSFezUk+Kmq7QffaQwi6HegCypY= 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: List-Subscribe: List-Unsubscribe: When return value is 0, it could also means the page is free hugetlb page or free buddy page. Fix the corresponding comment. Signed-off-by: Miaohe Lin --- 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 bb8e79381c1f..475524f79550 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1525,7 +1525,7 @@ static int __get_unpoison_page(struct page *page) * the given page has PG_hwpoison. So it's never reused for other page * allocations, and __get_unpoison_page() never races with them. * - * Return: 0 on failure, + * Return: 0 on failure or free buddy (hugetlb) page, * 1 on success for in-use pages in a well-defined state, * -EIO for pages on which we can not handle memory errors, * -EBUSY when get_hwpoison_page() has raced with page lifecycle From patchwork Wed Jun 12 07:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694538 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 8E8DCC27C75 for ; Wed, 12 Jun 2024 07:23:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B461A6B0174; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A64716B017C; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C4766B0179; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 18A6B6B0171 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D5AD81215E0 for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.24.81D7A3E Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf19.hostedemail.com (Postfix) with ESMTP id 9F1F61A0009 for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dhozlmqvkUuicMVf7NKP7HuYhNgBV+NWa3B+mDkPMbE=; b=DYOJweePsJHbpqgkOMUC/+mjJZfiPY23wpvN92oIfm8UILdMqdHcOAqunDNI3j7k++hdG1 BGaLG0HrIRL/k/dJ8uy6mDYLdbTS7Ie5Fq8tdOL/oDq2gZn/iZFjKx1Q2vF0QPjgRJhqVs nalnOec1g7R4iEFrVi88dWG4FBAulLs= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=K2P9p2hlbd9bcYyIf7Cni8DGXTv3UCbuPvuL1zfxGdwoNQIgwJoC8L3nQqpk+xBetkMYs0 I47xW5bxpsC2qqGXO0YALciQfHKdLMkUrKthsaTmmDFw53edz6Q5i5XfkXqCwsq4rgNjZ7 LQoYnDYFzZe3ebxXze+EFmtf6icXyIU= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VzcNv57flzPqKq; Wed, 12 Jun 2024 15:19:27 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 9B9B5180AA6; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:24 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 12/13] mm/memory-failure: remove obsolete comment in kill_proc() Date: Wed, 12 Jun 2024 15:18:34 +0800 Message-ID: <20240612071835.157004-13-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Queue-Id: 9F1F61A0009 X-Rspamd-Server: rspam01 X-Stat-Signature: mm7dzqma5knerwp1yc793f8p6umi4wwn X-HE-Tag: 1718176975-774370 X-HE-Meta: U2FsdGVkX1+0wEN9mJLpXX8NoqWjzORUDDJKteJ3Fh/hjQOPoNH6J6lCW7P94Q1yzEf2CM3Q+lQ+5m4bKb27dhOi4p62wktJOFSCaA3KPXP/qWqAHZusIF7cHdByHMwX/p+PwQDQCllUxVRuAZ4lqkKlf8FGcwjfT/ZBDlABteWlGv6piWW9ooZP8QYGgomHdcm+Wzt9UuBl6gtGSCPuBBFEAcMTEt+7cFj00lEsulEeZ3cP4Aujqt61f68OMtIT2DIZW8ONpEmtIQa7+XKBfk/+EgIG/QBPShkTRVLd5FNtBfdPOnTjta4NRBrA4YRhG41H2VcJsu6a3VGU+oSZxswrlzzLsQioCQwR2dPTQ9pKWqcNosMYKzOA9IbMkGIDh2Zsq+B1RQ5f1dT6lUwXwV5IsrH5DebckJBmkrtsm79dFZ/3fDX0Wn0aNp7CSpNTPuQjYK1BA0twvIMIvIupTSx3maRNhGFGP3ewrAGClc1FVUyXq/8b4HBae9OrgDVgImVh/LcGtgKQwt/6/Dr+hnoYmsGvpDcx1fh86DK8CTjlMctsurlJsh7II6dqZHWpPsyMeUQbawyJz3MTzOQbdlO9ihfa3R5SRYw9Q0AbJYz1n9NaSh66tR6BTtJXWfIBXznL+ampfk6Hq3l+sigAVlNf2kUwKyKjUaZV+M6VuV5i5gurnl1lzTlcUZT7fBIiJS1imZteLdSQpOkGF7MSL0T7uH99DOBqGjdfNfRxiVY+pUun/54p/n5tcyfNHZbMiSB+2y/v1qHQwdIRFmgNB0YEQcLaX+dFXYNm87nJ63wh4vxw8dxTSmXUE/80vXAGf+J5OsYm0d/ABH4DGRG8pxGJZMVi6EeOwNzH3clUVGLzD9rAMdQkEX1sRoV3VVGzHpJrxqgAtbLua+Vxzj84CSlDOK3LyLnNvvRWpf0tgjv634p5UNkzBqC7ICcwRQ5rqK/ujbpYWQvawL3xBs1 OblYg+7W +uBjxWOCpVL7FlKsSZAqDu4BlK3ukrh6MZZWmfs06lLdiaPMFX5HURncLBYVHNilUduecTo9+dzAcycPGSB3w+dDXnYbXVXeBzV4WDCEvVWNlY1q61c03CTteh/WVs+c//vFlKjjNF2JSiVFLBVDb1BzDfXVyn6QcXxxvPkLlHOCaqPv4kwGgu0OOuzyc/AItnMT6u/SS2fOSnXKVi79hB/iP8hO7SDnlFanjWRkgzQGiS5MJucBegaeAx9yqPZ1S3OSZ1yjWHx2VqmtqO/SzU2nKt1sq7VG7M3A5 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: List-Subscribe: List-Unsubscribe: When user sets SIGBUS to SIG_IGN, it won't cause loop now. For action required mce error, SIGBUS cannot be blocked. Also when a hwpoisoned page is re-accessed, kill_accessing_process() will be called to kill the process. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 475524f79550..12b516895ee7 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -354,8 +354,6 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) * 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 - * to SIG_IGN, but hopefully no one will do that? */ ret = send_sig_mceerr(BUS_MCEERR_AO, (void __user *)tk->addr, addr_lsb, t); From patchwork Wed Jun 12 07:18:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694539 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 BBC61C27C53 for ; Wed, 12 Jun 2024 07:23:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 027516B0175; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C56CA6B0178; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 799616B017B; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1367E6B0174 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C4D564149D for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.03.82E4077 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf17.hostedemail.com (Postfix) with ESMTP id A77A54000A for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176976; a=rsa-sha256; cv=none; b=d8fhBAgrkqkjJy/8+rlPPnHjqBs8UW3/vWCMKZ9YlqVWPvzIfBpgmpin/jnf9eHSk0++kE KZxIZNWkjoGi/3wTmp/PJ8DsTvnqd2TyTUnICDSRJfgsLfEdL4i8G0+6r1/geTS6pGMknH nCOZ20r1e+pHmEySoUQ7ERy3YcnEtqk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7usMGX8smH6mCfbTQeu7r6/CMfpkgeDupZMVSJ0tYyg=; b=BHCU7E05OwQqICsX7RfuoYcN4zccNLMmwlHdG9XqRIk8GDaNesT4ZzNJprkTwyuOc8CXD8 CsVGyjXq4wAYQIS/7DKIv/KWwYKueLyTOE+LL2L84EVUXlWwZJeJcwLCPkrWMiuRRAdAxC FkB0P54c9QHEehaXgDnpn+M5cPUzo94= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcR92RWrzdfy4; Wed, 12 Jun 2024 15:21:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id A42AC180AA9; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 15:22:25 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 13/13] mm/memory-failure: correct comment in me_swapcache_dirty Date: Wed, 12 Jun 2024 15:18:35 +0800 Message-ID: <20240612071835.157004-14-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: 99ka916qd4jhx8xzsceiz5p1ftq6fik8 X-Rspamd-Queue-Id: A77A54000A X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1718176975-861201 X-HE-Meta: U2FsdGVkX190Igfjrahf/2UCMJBEyegCV19P/FCp2rGbrIVKit9z1hsyrP/QKozuDNvYgmkAevtLYKbLDooOvoRuyve+LOy+/sZaALFe+StAMAiH0tgDaTFIxGFVlKRKYmpzOyI+L+wPlfCJbt5LAT07K8k2oWpIyJtLBJPOnxWHwHm+iSsawI6xU5pDCT38fGeBLOZUNLAiYgtDOqrDfvqxSAukIbRxsQhlkhZWePQ+sqzrqypw0VeA+WU7togGJWnGJW9JXPMpnUIBTczjh3DjuoEfdR7VpeCVe7/6idNQ9R2r9ENhhWcsJR0Nkoig1QXB3Js+4WfRKKMQuTO6PQeecCbxbBdTPWC5gj5zCsj3wt0cptulmdYcfPhbTdR9czdpm4tkvcpg481YzSENsmL8HHzdlhoo5UEgzYJBhqzLtg5FDtJtW48nEtD/sMX9JxBJnIK/sgz5w024yTaw8mGaOu5ks6hRMwGH/TGCCE8+h/3MkyVVLTvqe3FMKi8Y5UP0HLD4+qMp5Px0EMYJ6k+Y+njQ9kctSgNrUsmVWTaw5Pj5/Ur5hPPUR7+K1E6VmpsemybKAJm3TW/YpcAysiQiF4dLJ9dbYVpLwcMkekoM5PvvLfX+tKph2JBocoG6/AYx3uoupQZ/vxQmSbmxrj6MiPxDap6MH6tFL3VLtRXy90b1AtYJJdCvrvUpohsluqvkeY/CqGNp4fdy/FnvROjUOVEH4Re16zSqh+yV6en2Wyh+ddDscPsEX4gh38PpeDoQYi9HRyPhb9FO2WZnnHu/1KinE8jH7hBGxR3mHpQBG3j9dF7oTW5tON0BVhjCMXlOyj7d48iQbJ/pgaM+YOlkOjj6IilVVk1wQDd8TuqStU2eG7xpNTxFHD/TupLQqqxAP1FHf+2vAAoGTa+zKv1k9HQmQqyJGPAZSIQloEzyw7l2P04rxLcvk3o/TNKgnWQJxBHbgqrKOC+NnSh nsus8SGs HfjGyamiMBOpjGHpiXnvPvbr2PXGtrDQl32BQTHkmheS5iEcXWl0Lk+VSfGqboP5/TC7Mk1pEGIFGdvrTHHmMbGwzBTR8fAg5QBjC7Mk/B1prWe5bQiU/WOeXHqoYgRHw8jW5BZZEsCdYWmcoyKTfKBZ14q5oyp38z/GGDiMYtfaR+Qy5cNBXg8M0sFBlB0No7BJMo8FEm2TjiNuk4lIX+BfB6AKbZXLFdFe9DRYHolopJIeAML51VBmOhf8THLUxcYYepVNn09ne2z4= 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: List-Subscribe: List-Unsubscribe: Dirty swap cache page could live both in page table (not page cache) and swap cache when freshly swapped in. Correct comment. Signed-off-by: Miaohe Lin --- 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 12b516895ee7..2cf7acc286de 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1126,7 +1126,7 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) * Clean and dirty swap cache. * * Dirty swap cache page is tricky to handle. The page could live both in page - * cache and swap cache(ie. page is freshly swapped in). So it could be + * table and swap cache(ie. page is freshly swapped in). So it could be * referenced concurrently by 2 types of PTEs: * normal PTEs and swap PTEs. We try to handle them consistently by calling * try_to_unmap(!TTU_HWPOISON) to convert the normal PTEs to swap PTEs,