From patchwork Thu Jun 6 06:32: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: 13687855 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 4FCC5C25B75 for ; Thu, 6 Jun 2024 06:36:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E8336B009B; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 695E46B00A0; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E8AB6B009B; Thu, 6 Jun 2024 02:36:30 -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 E595F6B009E for ; Thu, 6 Jun 2024 02:36:29 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 70992A1332 for ; Thu, 6 Jun 2024 06:36:29 +0000 (UTC) X-FDA: 82199504898.27.838FEAA Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf04.hostedemail.com (Postfix) with ESMTP id 4AD224000A for ; Thu, 6 Jun 2024 06:36:26 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717655787; 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=W+7LXwTDiGUilHmFUIGzsle0jOHi6iWHEjf5FSGhifmli8VMUEiZfMDZQ3DTvGt3OogWxo K5eUVdpJSx8HqaCzCrGRit+iJ/5AI3Z7a+hAbcDrVERLngfoXWXZMUUItmbZV87azNAZJE vtSL+iLdFu153AtyAXdM3pbCqkm3rmg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655787; a=rsa-sha256; cv=none; b=z1dGndSW7gPOOdrplHB/d+sVaatnzfhWaLsSvcf9PjyhehyKaOpUyj62044rRUE5uJI3wX IdXvnbw8RBKF3qtjsdjC43UuLLmpCbC0nF72XdJtM36VnVWfQlhBbP9DfE8NzjHSMzPn45 aqbSgt/I55PGgKzKELv5C4it2GgEEaA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvvdP3QSNzsT8m; Thu, 6 Jun 2024 14:32:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 26D9F180085; Thu, 6 Jun 2024 14:36:23 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:22 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 01/13] mm/memory-failure: simplify put_ref_page() Date: Thu, 6 Jun 2024 14:32:35 +0800 Message-ID: <20240606063247.712575-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Stat-Signature: nkpfiba3t7tre8u7p6kzsdu5orrg4y4r X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4AD224000A X-HE-Tag: 1717655786-377904 X-HE-Meta: U2FsdGVkX193EHt/5GiZ9YQT5PAbzJ+9ba7mTrGjHSHVlrVdWp0cuZZP6bknUiw77eP4PP2f2euspZwfjOeItzidOvpohmsZHMl5Tvkygf5WoptnTLdyaT9ONTvD32b++m9BFDqXauhESZarunyqcFsYZMjkzxziDIjZw8zJmVkKmma0buDpr5qplztOuO+c8zlFVS80smouh0McMclwcD+Zr2OAd9k+ca0UOxZI6bOFH8hTgT1vdZ2t1eaZewh3fKlRb/6eAFJR/k+k1u9kswl7DdhkQQA0SdEH9I9MfSNhHmVXKzQ0FzPkfXt0g1D64UfDI2YnA6OHwAkd+hCmX8GV5GPnBDlWgvo4eDTY8q1BvTO8TAbSLSFes3RsBxMVqPRJ3QcVbNT+lME76FmbUnTwYCy206YmOXgTTgcuz+dIbNZ6XuCzpSRH8O/fo5PGui9rLkvVTfemkuLdULYrKrnkcO8omFuY858V2k+E4OCIE/N5e+g/Welab8CFAL/f/6oZ/NzqWs7lrpXqzsLGzXBICku6aFjeGLAPnzpDv26DQSQub/i5qXkgunL9C8lIJBh8GLXQQXEiNJF+wyrYeHLcZ1R1tW0tA1B1l8oFVGSI0iCG+LSVolyQFGbVkS8MJdeIY8JRQM/eCNlfxq71zTLe5u0IKtFBfnFYjOKAyLVTQ16XvJGpzBcuBUbsDECXrIZNBzsnKXwEAr61UDx53DUove1Bh7cef6dbuNdC9g3KvOqDfRD+9IrOmdlJsdl3wkhfXbGJPh8fHt/5x2Gz9GVWM+RLQUk1wY6dlTHbIp49CVhtkabRlPAVJjqba/I0xFnl0M+x98VUd6naUAjdokjj3h+tr5o7EScL1D5XCouFH4woU+7jgLEA8fLUyVX8FpbPXdQnmRQwT1EhA1QibVRVNvQXL8nCm2SnD29lE2ZVFRQjG6hJZ+X23dJ4BVLLSV9CMoqzsCDGQVtNYmi 6beXyZou PB5Ci02+uKlq6Glwm12JoYJKhmHko77K6Yd3l4yh2tUfpyagWllDRIV2ti5Z32oaEUMHpZCVdv4nDSd81r9PtTE3HdeWJsOeNYPf0A+dSuGTwlqFkLwTQsuJyDeanUwPZgxzxTkXZu6PZsmf4sp3L6GHlEBYTY61a29xqk3YFNSQh7WNuvUxCYz5Lem2jVh0XoiZXn/pR7e2lCgUZJPirAkCpyogtbH3CiP7FDrMj/yOA6gIk/q+LwvjCFvMNx50vn1JAw53vlw6CwwM= 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 Thu Jun 6 06:32:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687853 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 A6B90C25B75 for ; Thu, 6 Jun 2024 06:36:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13F656B00A1; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0784D6B009F; Thu, 6 Jun 2024 02:36:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E66486B009B; Thu, 6 Jun 2024 02:36:29 -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 B8F076B009B for ; Thu, 6 Jun 2024 02:36:29 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 58CF981108 for ; Thu, 6 Jun 2024 06:36:29 +0000 (UTC) X-FDA: 82199504898.02.F27A93D Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf11.hostedemail.com (Postfix) with ESMTP id AA1F64000E for ; Thu, 6 Jun 2024 06:36:26 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.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=1717655787; 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=4Org3db95hgd/T9upNODy0e33vGsSjIAFTirQpN/MMY=; b=SWJmu/20h4ji4AslPNx3klgPa4fBYhv344Cnw3vn4KsQlwI53UPx5L1pW/ojoUjq8MiCtN f+5h27JUQsp4TmpgFtN7oJ4oh5yTM7bYG+hHjQ0LjMU1JeYOZX4iZhXygQ4kG8U2tJ2tBx JtH07jpQIgm6YDXZhT5HUmeF5E1ADrE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.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=1717655787; a=rsa-sha256; cv=none; b=sPia92wi14qvlMA/KuDr1UT3J9GJN0IoY7Hh++OpaFGRsqgXDIiEkkDnyww5dH4+/KBhnD VR23laQEuRvkNYudfyRsC74WhvczsVDEB6mWm5zmsfhdNYXY6Bis4Z5UnhMhI1JP8G8Eff QuwsY6o+WhGDT2GYon/JBY00uNdb7zQ= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvvdP6DTdzwRt3; Thu, 6 Jun 2024 14:32:25 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 9756218007A; Thu, 6 Jun 2024 14:36:23 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:23 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 02/13] mm/memory-failure: remove MF_MSG_SLAB Date: Thu, 6 Jun 2024 14:32:36 +0800 Message-ID: <20240606063247.712575-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: AA1F64000E X-Stat-Signature: gg7inep4hamc3ejdwxzt4nafk9hh8wfk X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717655786-769384 X-HE-Meta: U2FsdGVkX19eCWNvwTdzWQ09+DN0j7wCZ5MgsoBsgbTaLPXOH7rno0cdaHDqY8qRf05/p9uPe50Bv67Xb8Xp2t/ckxO1Z0Ligifi5DGjwk8YHtk/gjKVeoXTcuJdIJ6ZrtPZOMKa5qi20+6X6gnA4U7y1MdgnPNKmtgp4sYuVA7qZielng4ZM/A8mcFp2Mge1gfY1gBB5lcuw1oVP+E3zoxZnH+B12CiNAuKhyIOUeEsZX7saswL4f7fYCRPzT7riqbM0PHB+1+Fz/y499+9enGdP2AjbGsTCAGy7AtBnEKpApS2hI6i8TX9Uq+CRnxhJHX+aUaOi7MQSuz2uSQ11rDY86I4cRhmXphpbSWzGJv6lVTymJ9E5F65PQV+i99zNQxerVvrtKDWNyLEYmna7XUJww26LZ73fjcXV0yS9V1jX5v/6wWyL79nfvf6e/LQQZ50SpCa45+TIaiqR15RxNji0NVU8vClsXtkJcBCSLgcme/aC4vHB+kYBL9KtXn3ko3MP8kRE+op2deRa1a+N6Yug4edlHz7Z9Y3qDSW5hz3ZYPGDWDIQ7ModJeEpe+7gByTEBkS5YQihd7xm91pUfcC9+smtWtFAfUo50AFN8XwNSpFTtL3JmqfuUm/2DAbsieq5MnMJSYvEE1/m5ffvzjaVuI1Kfdf0ZS2/lB9td2Si7mIcBQJO3fmozjnQfwMV5onqxeFX3nJlu9SkR49X2M03lG4MXE8jeBQ1IlKdFvAoOCduhZwCNzoShcB4sl5FRE8To8mTlylyORnQ0yMvkmdk5xGQl0H8lhppsJ38RY/oFVj4puBTtskMaGdrLRBtFT5bkXHQeglyxppGA2z5b96l/Jrtxn5AxghRn3U06XMAK2S5S75VaSiWWzsCDS19hVGv7HLTdgDznRNT3bCGYqP9L6eOZXVNPScEXXYbVlrchfFb0mcbka/UBw0LtaW0Jcdw26UlumUMXhqzrJ DGl6glxA +AMUmUNAIWpgapC8tycoogSPeeK1I8dgLfLzmejj1txwBjlNhk8e+BFShvXG77SczJHbX3vZ9yWph10mGyr48f6R933Zv/jTV8tqxZ0Qj48XLWf/eoxh7ajnJDkLXFgvBvGp/uoGzJK9++usTqcEsaB+0teMnZ5bS4VZOY+vm/FiN0CvVQRP5nPrFy46PZ/AeY5eMmCEYEYrszDjkggH3iNSt7VQEwMvppJBU16/GiLg+smT4MgiJWKKvencUDVGUGicz7Sx+B8hOugM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, 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 04795a509026..ec7141fb0252 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4078,7 +4078,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 Thu Jun 6 06:32:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687854 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 1506FC27C55 for ; Thu, 6 Jun 2024 06:36:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55D8F6B009D; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C6996B009F; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13B606B009C; Thu, 6 Jun 2024 02:36:30 -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 E57446B009D for ; Thu, 6 Jun 2024 02:36:29 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 80E11141376 for ; Thu, 6 Jun 2024 06:36:29 +0000 (UTC) X-FDA: 82199504898.25.54C117D Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf02.hostedemail.com (Postfix) with ESMTP id 230C580010 for ; Thu, 6 Jun 2024 06:36:26 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 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=1717655787; 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=WLtXNk6fVS/RTo+pZSHQ4EkfsDyIXh71+h3Z/IzJFYEY2Eja1jFZLW3v3Ef7YFpF0GmIZT oP5lXeCLKqpF+11d2YCw1sLu9A0N9pQ5XqLrKah93HczRs8AJXLK8ys+kXrkar6Qx8bwFo vONz5z+bd80e+hb3Wa8rHnhoxl/MXOY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655787; a=rsa-sha256; cv=none; b=T9LnuRM0EtplPZjunZtXI3O96v+nFgsF7KSUxgqY02MyEE6urcxULwo3Do18xaZ01MnGFJ p3a5z+wIvkNOwVz5YZLL0tsbreCXGMh0dchTWA/KLLYf/5l/BHXqtZsKNV9hsyQvUyFmcO OeWRP9Qq1m5iKuU3gBjekSjQe9satGg= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Vvvf95PB3zPpZH; Thu, 6 Jun 2024 14:33:05 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 16305140133; Thu, 6 Jun 2024 14:36:24 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:23 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 03/13] mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM Date: Thu, 6 Jun 2024 14:32:37 +0800 Message-ID: <20240606063247.712575-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: 9ufcyi3g33w5ff9sefpxw9t5ggbhzthj X-Rspamd-Queue-Id: 230C580010 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717655786-599041 X-HE-Meta: U2FsdGVkX1/9yfAhFB41zUVxGJ2xeOUC3Zc53WLRDDbg3sxT0wpDIJiEI/04w5cyt8itH2v1xmRUf5UuW3UU6fjXVNaNYHG6Q1F13voER9r6zVLOCsFvX3N40sKZ0C8EMAmcFNSdXR1ZmkkXgWGJUSQKUnB0TKmhMxhlVeu1Zhv3SdanJhfUPvzXyysyWsTlyOOPKQfeUD/qi9TKa/HCQtIgt7foSI/SmaqfOUM2xDqZMTmb42VywC1jjqRTGL6eJyCIzKA9KC70MEQnz5Z7ahZ0I5f2mcZUvIf6glYCWxa0Jl+u0kPgcLvSzlAMWQkXBGOHSqKWBoeiwhvtN8MrDMLpmVdP0Am7hKHMCY5SrLh8tzfVR4he2Yvu/CvyCv7ZAneRrcIAoWtf9gUYfNuzg1q/kB5r3ZcG9wlxK+N6Q+Yrs/KA6yUx5s3i+WvWim2mdULkAcr+8FC64e5HiPBzRBnrcMZ6IyWYQ/ZHjfpfTosib3llIWM3O21b9LWWbL8e3gudxDKFSZ5DUH3HEECub+Mn8Ce7zkjfFAvgTe+Wm5TRAqeivZk/LtwS72pALL4eHE7PX5XBJ1XnhAZNeH5yk97z9avaaKsnlIfMCUfOGDghlSD30yx3rOcuslQrwSvf50KdYBk3qqWmVhL5Xr2Tizj4yer00jKCnKCKx7XmsucDyWXuC6g3AXA3Ho/pYK+bSr8FydN83HSwOmcCLjl+ySaKQhq+DNhoaRd70glEEgqFsdxJsBUpupCobYY2pTB8S5CtXerBNbD8VYB9KmQASMRQ1ExJMfHl7H5uN7B2DeTrZeaOwgLZVBkl7U/8HGkOMS9ULix1ukEurI+cVofPD0PtqBaYMpNhhYQsssfnsV8ZE6M/cRGfmftu4MsSMONhduyRB8l0bdxdJmXbbDkf4soYZjl8eoMZLtHcpYJ1Ip68VNPXQjRspwJZquC/dBsp6MZCX6j3xMSKigELEBS RW2xYahB HZ0NixrneOHtxBK/wZx5bOLrTwGuaYb8s9VXUlZlqkQk74sheOBYegpXSNQcejqdimK/JQBN3ATKxm38tybH6niiHzznrGKLtrdnQFsqcf0MXIORA4m2A5wDmUhebxSTxk37H4LG4J4/JsWk092I3mxQdffd9WbSVS5YpdiVdowY4aCR3GErzS91xGmumTZuczHnNSqtYopF4KRqZT1VdMp7aE8DAyW9pcRhOZ83ajv9dquc3X5WpTrHcePT6gu4+HDmkOcH79uAL65c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, 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 Thu Jun 6 06:32:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687858 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 78B6FC27C52 for ; Thu, 6 Jun 2024 06:36:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BEEE26B009F; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A147E6B00A0; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 866B26B00A2; Thu, 6 Jun 2024 02:36:31 -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 675866B00A0 for ; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 20792141364 for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.03.2138BCA Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf15.hostedemail.com (Postfix) with ESMTP id BE4A8A000D for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.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=1717655789; 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=zCAOwmkLrpqqATP+8NsyTtIX1rQ2wiMZWo7QmNe2DN+O5Bfj/gcGZyE/WP8RmanfwjLn/8 QMdujtHgFSfBb7l7s+g8ZsiT9uabalS6G83xp/TiNd7VXvDG53Hhe5SZW/qlapGqYhhyue 12h/uOTIW/liSwcOhzJFT1QO66TbbFc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655789; a=rsa-sha256; cv=none; b=fWiOhaA3GAAqLRE/PcpiygyCHAXVlMcSfKTppWqMkmfhtqp/xR042/sqNBEOhinnS3vz5D Flv45sIKTNA9gTkWJhJHWvaawszvIot666Ws0RNyrL/RZiLJ3o2VB5jbOxruMEB1I+mUMp 1VYGP8C3am7NiOhKn55brmdjhAJtvjI= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.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.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Vvvdk4zllz355cV; Thu, 6 Jun 2024 14:32:42 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id A018014035F; Thu, 6 Jun 2024 14:36:24 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:24 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 04/13] mm/memory-failure: save some page_folio() calls Date: Thu, 6 Jun 2024 14:32:38 +0800 Message-ID: <20240606063247.712575-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BE4A8A000D X-Rspam-User: X-Stat-Signature: xjwte4qewtupey7wq81un4oboxxcpyuy X-HE-Tag: 1717655788-491629 X-HE-Meta: U2FsdGVkX19zRrCsnDW5gGlUIAcxRFNF3jySLke1gbN/Lyv1np89OQk4xwzm8xZhRNEys2mTwCCtcyDyfSSLkqEjR56Qo0ITv7G19jeu5cOV0H4SUiSDsQtO5P6E2ZorV5H2SlMDe+Mxd1Bs6iEyLgBUDEJuuIL4JiVZzBXzo4y77HFWUmzVOQiKdqiTjCyuUVsaS/jjkEZAHdZwziujme1hFw5a7S9inw900TCYFFbv6KbEvmopNWTnQa17eYbZnmfPzxI9vCbDUxXvKyu/pQeM9QqPTG6BvNaUM1sHfm5Ury7AElTC0kumV7jIkVQ6lgiixA3jMCYG8DMzBYo4T4RBiqmRC1t973AA3P49pYKa2O4/l19tgs79paa4MaKHKx1ExcM7ariOv/KtvaRmNUP5BhNjb71YJpZX5IjDbv7uAll5bLfMKmFRsnKjvniny40ipZ/kXse9FElskztF7PI49/3qoXnEoPcUZ9Lp33iYEtS3FdVY1nxUwdl0ozbWGSop3VLk4FbJ1usG4mg1teoKkLGilumM+yh9fgMe0JDRDguf4DrFPpJ5/ZBJ58tQe/brukyD2y0AF4Gj/gVtjwh6n/HYrOsm+FHt922mmeq84aQRYZWlk5EnNHVz0ZrtgN1mBSW3Uv/vj0wb7BL64iyHfEcwijy2C7Twkl/C3Qmrh47Defxf/7T9ypgo68QMAXFcRspjdOM0NrBweYVqfCJ4j0lFw4h9GJeEBM4H55UiDnLztb8BWXrPTYDyxPjQaIuSo1Sf4UrzsYDXBGYLOqiq0i9EVA5w/8hcv6CcYm6dNRWHMXnxm4g1mCHV6q9WgSiHGlbUHni8yDJU8XdJj7rmitpj2slK3H7awrJD5MMpf3AWe6pyx0DAzg131Fudr/19IVOjzinjj8ohjWpC6Z1adXguRGYxzuwqJqmnsU1gl53pyNblDGasrNQH3v6mlDfHamf0nD6ayC8uITu z0ZiT1eF +Lj6Bf9hx2Kj9nUmdpvZcJs6XD0LOvATa6dgFNC9nRz8Db10XX5kdhvBVL7ATTcaQJA+gUSlH30Jw/NJbT8lyCVz8Qz6mBhn+ULF+HupojgTVvVIGuwFV7c1ka1/cLkgLfU59yisL20UZrOYMXiERaPiMAnVXXr0tVvmIB+TG83/QKXf/67XDm4Z/F/rC2xgFDrifkTRUphJYI9aJvmpZhd0TJeJWDLFJOh0pBe0ObhKV/tPuA8j+G/zQ0EZczYK0KuUf0VS/3VtCkULvBcFUrlBqm2s99uWMf9ei 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 Thu Jun 6 06:32:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687857 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 7A684C25B75 for ; Thu, 6 Jun 2024 06:36:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FB8A6B009E; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 383E56B009F; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2735F6B00A0; Thu, 6 Jun 2024 02:36:31 -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 031316B009E for ; Thu, 6 Jun 2024 02:36:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AA30A14119F for ; Thu, 6 Jun 2024 06:36:30 +0000 (UTC) X-FDA: 82199504940.28.F27573A Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf19.hostedemail.com (Postfix) with ESMTP id 6CDE41A0006 for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1717655788; 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=k1+TmjKsp6+JaiUdw8pVYvfo34jX+nfydUlKYTQFMTv3324RpLjQkK+yzhuzC4o+sT9bVi Aq4yOOSuQwTTdYLdpbCtGSfnsYoQ2ANKFkrdTAqHJEQbsKJhGP3hBWYNEUYuNYA9xdtZsJ YCRpyrk3u2z5XPSObZw3l2zRocuIm/U= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655788; a=rsa-sha256; cv=none; b=Qq4a4yEZEUrMh+raMz77TLYE3vht2CpsMAum7Vgsnej5CxN6l7MDWHwoThCpuNC0beyUj+ GqyrNQwB4K+NIUroUXzDgfF+wSqG/ozLJEgus2OAJIi2Jog2Y3MGTlZuuc12fi9DAO9jID Wyk+HQ//xIHlvSAyKI3HOP0haNbeE6A= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VvvhN4h4DzdZNN; Thu, 6 Jun 2024 14:35:00 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 2B4EC14022D; Thu, 6 Jun 2024 14:36:25 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:24 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 05/13] mm/memory-failure: remove unneeded empty string Date: Thu, 6 Jun 2024 14:32:39 +0800 Message-ID: <20240606063247.712575-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: 6CDE41A0006 X-Stat-Signature: 6b6nqby895goweh5wp4ticfjbhw87ykh X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717655788-473732 X-HE-Meta: U2FsdGVkX1/5ei14NI62pAn5Ff/nwiPXvE9RYMSDAj7YxK9nsY6/e+xMpaF//64iV8eJhdshXUGs6mDaCwS+WEbnAePSv3QPFyuMbEukikT6VgSUeCHrHcnRxwkA5ds3cjfZlnsEVoOaMqLAw3sb5lPMagS1hCKahIXVboAyV+jW9BLJO8hza3jZIy1wm4lpoFBIzYpxO+h5C5oiCHshZYOyswgeJlK8LSJrnea2apm6Cvs7OmrAd+NBl2oC55eUBGmLxTycm6V0kTKqD00zmpH5JFpxfWm4QK6OIl037VYWNljUMKtxLKYiWJUIT3Nu8TXc4HrDxfEd6pmLR9IQPhjAR0LD4PMw0RKQJNj9oNPP3sca9OOaK0QmQrMKjcvVhEGNQSqIubGC7MoRa0QLmvxsxyBuCoe3lJWs4qSLIZgaWrmn6WRayh/8nLMJixh8e8fkNoCMbHzXLIWbI+f+fXBSchAOnZTglnZ+/xnoiBoGZH+F84R85zRAwLlifckDGsaGegSUR6Q8RteY4RyV7xRaeIp2ig0l0bH3G0Et4VJE6W7+Hh29fJDfoYhCw0ZsCQAvHldCJa3J22/IqAau/AacrTHZDrjyTmSK3QuJ9yXbM1uV/A941fQCeR2P04qB0djKLzzn4LEnOo293SlthOjYSTVbxCvd1J+t3l0QpLGaYvYz8vUxsQ/bVnHIQoMKvBegaHAPO4ehMOqFlNNsPXW4Tdw5RiRcLC+N0gbDwzbrnrZfgAD2kuSYXDpt2Q8jhXXJhoUPRbVA73CJP4iwvhNoi+TyiKMEr6tkaankYuOwAhkOrhfeHhl9cuCBOwizA22NJLdQ/bSU+QCrdFN+PkILMm4RwNoViAKQQXLTp9cl6LgNIlP0ZhLoAzWLyQvlWsUv1lWSheRFSe8T8MGrjFX//4ZS77Q3ePQyzihmQ7acpYHlEPOs4NRKonWU8QKVOZza9LOdxSQIk64g+rk WaPJDS/X yjTmbFK0bqZPpPFjZHjApY9aP6dyctSIcP/RrzUT6jCfK95utlsDvMUikEXCb2r4+Yvhd3h21N4YF1JEj5zSfHlG9ujXQUjPwYU/kNZnzc4V8pgqKkJrWccPI+MG7wENhj7LIDur9W7XplB1ySQIAhSOWqV+6bHDHk/R0Df1IoEef/du/oPmtMEqgI71WW0X5yg6ESfcJF/wo4ecmN/rGAOAxU3XaFWRQZqXr 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 Thu Jun 6 06:32:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687859 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 8B3CBC25B75 for ; Thu, 6 Jun 2024 06:36:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 404386B00A7; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C6E76B00A3; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7BB6B00A6; Thu, 6 Jun 2024 02:36:31 -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 A96716B00A3 for ; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5EF15C1242 for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.19.EEB803F Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf03.hostedemail.com (Postfix) with ESMTP id 2C4212000F for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.32 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=1717655789; 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=p7hBGawIAKakEBskq0D61fcdrr3ilJp3N3x9c84OWeEd6unBWuXqBCjc9nNDU4G+8Mh4bh cTheN07uCLYUEWmoEJNth+kPVN1wRse3+NsajJbyzvW4mnU0CtV6ODCVaGQXM5zwqo/ZT6 1KEne4FQWWCGVAQgjN1tZXYV7DIDGI0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655789; a=rsa-sha256; cv=none; b=PVfok4LeiW2MbBcBNDjPIfJaUj3gZIbldMW1FFgSykCVXG7KqK6lOr5Ey1xsa4mYU8RsmF cpbZBWfdIXNe8vme1lb43q5JWR3y3MkJ0TxjGFpgIBhITNycRT+Kf5Vj4N5UADP7EW9AS9 eeaKQoIqMRWRMlFQbrvEU6MVb1E7TJo= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VvvhT19Fgz1xsBF; Thu, 6 Jun 2024 14:35:05 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id AFA62140109; Thu, 6 Jun 2024 14:36:25 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:25 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 06/13] mm/memory-failure: remove confusing initialization to count Date: Thu, 6 Jun 2024 14:32:40 +0800 Message-ID: <20240606063247.712575-7-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: jgau68zrtibo6xzhugtgb65umgdg6g96 X-Rspamd-Queue-Id: 2C4212000F X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717655788-86182 X-HE-Meta: U2FsdGVkX186jDoD/NLVPbsfEoPw5oXKTPryuxS2hd8XT6tGb9mVJvyxhJwHmkRIJtM/rhHnnlK1KMXYsEqbiKY8BQTI1XHmyQMXrzwnj8zsIMoz6udy5hA7aLp5pnbdtFtfMPJqY9BYL/xhZRfTGiQtJlhp7SjA9FACwpUCtnuK5fuUJGlswJNLAvypSN9xpZDqUbmQeJlSmpgogZjfyloyzzjQtXYfn5t14gh5w3VIODM4Z542uFQRbP1A9oZCeBmsepej0gkEaBMq+phi4TsWviEn1MG0GtTwmZGLXgnNO2CZpWS+uucEOoUUN1GgwYVYzMUmiruNZlL1lHjliQEfDKVpbRhBVob9W+fiVQSrmQnt2EUwRksR7DdgkgRJTjpeRW4/HZAvLI1h6fgGVBUT3QCCJVjA6exIuVTxXKGfdzaOEIWAlMT7+m3/BR8KJUJoOBFY09i7iAGJ/FZbsE2PSl655KVz8Gmzq0EB0+0pOnto6aGkcpH9fhEzfp/K2ZxJF7HBWnZo39qTzJIEFwrVrvGQsoZI4wS3npIEKp1cUMbbmmAqQB7CMOilT9Fk7qyziarmOCJaXnOcGhMYAeZpHW5B+cHvzm+fv5TeMOzp+nX+6Q3jC8IQAnX2zNNhJfNt6DmCXeTGliqG97G0ZAIb8YX9b1I22gXmiG2/fG2PAjhznV8BmJQY6l+hFpxE4UE6RgbNkguTg3BdvvuEtm7fxPhLqSMmhUpNCTvps00CFbSeKv81/1Zc1G52K0Xdx4nkx5xMBhH51ap2MGGAPs96ve+i5tPr6iSJYpeL57m4Fg+gi1ZgFSHCFQhs9cOBcp6SrntuX3CDd86BXXsJzLADahUsNLB+vapYmHUgU+9slgohfKxuactIN9hJXqsDUj8UtoNilEgjob2KD0kJj4VW2gJvUisfiZkhtSaROIoJxKY4Ym62TjYrXLvEcpTXHMNE0cGCJ3cCd62Gtzi vxwjgm5F 9ohlRh/qNuINbAZJxCNYruQIsWfl1ddrSuiY6NcdnGvEmMJnpatfMmg0ToL3lnc37f4C286YCKG7F8hfzQ4YuQTXRnK3F0sp4pgSN/jKBBl/u+nnyzpgcmnny0CANu9kuaC4krMghF4y08hLb0HAdbTlDYOvtQDwCvuLHF2n0kXadY6cKRChLSEdvFgvcQjLtyTQNLtnvIE/Ce10Svo+yDuRBoA== 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 Thu Jun 6 06:32:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687860 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 92D3FC27C52 for ; Thu, 6 Jun 2024 06:36:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E1896B00A4; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 61EA26B00A2; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18A056B00A5; Thu, 6 Jun 2024 02:36:32 -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 A7B196B00A2 for ; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5CC7E1204FD for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.20.C6B54F6 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf17.hostedemail.com (Postfix) with ESMTP id 1D18A40015 for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 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=1717655789; 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=oAdqwmoWzaCUMMqmLRFpSOTmOfuJ+JKVUuDePttXAWA=; b=cyp45MXhHymcPRwDN7szsYc/0eU7U7iiZFNZ7P2G4XohpW3a0ePkRpt74aqVVa5eNL8wNm 9HXTbJyCRtCOKU1NyvnnKYZuKXNhVmcnJeDtsGU2rX7cezg4ZaCIMGI+L8RtkAgQeVbu91 Qnnqrp9bjRfBbM1a52ch/St3dxIAprA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655789; a=rsa-sha256; cv=none; b=c3RD/F7q7VJjfXBV33sY03El0B/4erIrG/uhMl5/Mf/if6gFCO8cYSlf4kNDIi8MTh9RhW as9yzHMP3ROjdz3f88B0e5yyauwJfbIhQyjv22casbiLlshaiYaF2DZC0ihXRG/xyTIDem oXC0HzEXscIWgCh857L4GQAX3B3DihA= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Vvvdl5g3Fz1S6Hn; Thu, 6 Jun 2024 14:32:43 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 447E9140109; Thu, 6 Jun 2024 14:36:26 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:25 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 07/13] mm/memory-failure: simplify unneeded hwpoison_filter() variant Date: Thu, 6 Jun 2024 14:32:41 +0800 Message-ID: <20240606063247.712575-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1D18A40015 X-Rspam-User: X-Stat-Signature: fz7g7hn3sz9prquusqohx3zzzq1xm553 X-HE-Tag: 1717655788-509685 X-HE-Meta: U2FsdGVkX1/i3cSzKrD25zmWptzixaPN1nRRMOueDz4YD95xFIzclX4bE8oTebOYbDw9uzNl1AS36s7azomHZl4jv+1iQw1WYX4lCCPywH8POhQGJLGe9FpcNi5fyjtYjkhSgklwqaeeCIfxuQXsywai62imvVL7oM27XKDnEHvmrmg6F5naw/S/VMHnfxNv6TnyKHiMZT2d+Z9r3QlA5nKvJjDrQngXO2BHRQc/75DSehwyEPGj8rHnI+cq0AXG/n47kDj3l124nwOwKQ/nHJA1NkLNlxRAL8tJk1Tp9naeyMlR/HG01mOJjyyLh5hg3WkzvylhbVpQD+yOc+FG8FwblBcaVr8vNIzj1i+n6GWAmofwFiVNc7NJNqQVQBEJLFNJr87m3xlcCTKOMKF087Q9XodZ/RQKc5QFY47MEuIy3cMAAQcpX/Eo/KXPeU6eTcXr/sPxrg6rDEL0opcBRmzQzht7CwsYlDg0TyWg2MzxPca2lIsDNm8/AYnd8NRa0aMvkfIyRGSKUXcHRLt79xlqH3y/dpIuNbCP/DkMC08rxURr2ollmeFipwURTJV/dW8I79a07UDGLB70n9d+2oNExKNMbYXRJDYctduM4JLZJyf+iUSR3o3P+pdcA98Re4YBnU1NU0r8f8aHDJol0WS7z+HCoZdwPe1Jz43M9Gk30mkwLUPfqAR52GfFJw0rEvEIg/5KOVTuqNs2VViaZCKMysPKRArNfyOjsl9Qesx0i2VzrdOfj6LBsDs9S1l5Fzc/cBnM/cFhL++KgT0gT7+2PNuTIvDq1ocaOU80GJCD9Xz6LlvKKfS868X5WwHhYaLDbk7Jn6yqgc6gvck7+YTMIWqIB64u755VfIHTQSOflKrEaffYFXcbTmQPK9gwRZKQgdERgz7+1j97T5GQWBWW4ZfkH0ND28Fj1tiMDiwVHK1Gq1g2jKdeGQL5L/2+H8BPRn+pekNPaMg0gw+ V5h1O2kK MUIrzxq55gbEsITX+p6tbltmiiMNZZEjmQoHqgEg5IeqGWUbaUOzc/v6o20s+H7bxoRH9mxPhSLeVS2dgkbZBYhTkPRa4PNRoPzk/ftSKQZl9xeSdJ3a1CWeUxJXIlM9JG3WPWPVwTLFVeEEHYtGst0qR4Zk0y6P+mMmhNM/tpH4Y7aEnnasJT4Jw1n+VMPsm78Czt4Oe6f5a6X9fO1mJQ2wdbf/sCbJ9aXTil7eLqgXbK9b5JjgQK4xW9D+BOi5T0ICw6hA/GhyEtwXKndpQbypYEQQn9PUoFM1SdZTxnZX7kzm8bYh0TRdGOgQfrKrer1cB4lczZAJ5+oH2oUnSOAX05A== 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 and we can further make it 'static' and 'inline'. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405242336.o1NEOrln-lkp@intel.com/ 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 339752d768d8..6e26b8b975e5 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -294,15 +294,14 @@ int hwpoison_filter(struct page *p) return 0; } +EXPORT_SYMBOL_GPL(hwpoison_filter); #else -int hwpoison_filter(struct page *p) +static inline int hwpoison_filter(struct page *p) { return 0; } #endif -EXPORT_SYMBOL_GPL(hwpoison_filter); - /* * Kill all processes that have a poisoned page mapped and then isolate * the page. From patchwork Thu Jun 6 06:32:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687861 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 B0688C25B75 for ; Thu, 6 Jun 2024 06:36:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4FC86B00A0; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 932816B00A5; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FAA26B00A0; Thu, 6 Jun 2024 02:36:32 -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 B3CFB6B00A4 for ; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 68ACF812AD for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.17.DF461A2 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf21.hostedemail.com (Postfix) with ESMTP id 46C091C0008 for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717655789; 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=soZo1En9PzWQ22PcQTpjA68XblULjTXmSbLLAd3BP2w=; b=Yd8AgwwesOPNbCyScCjZbvTBekLidgFentisYVUpTuszTo7tGhuBmXbsZnbX9NPuEA8t3c yS9V+JCmS49fvSHcf0nJhSC0zsb/i4DLQy1FFcF6Xhxbhr0tRboeGuhb1JWWsd2jsghO61 J8aGgxoPhhnS2VQZziKwzK8VVQKBnTY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655789; a=rsa-sha256; cv=none; b=yt8wNorRxZxxctt1Oz+Ph9rnjaVlS+TulNHxk64LkgyroQIw/2/lRtXkEEu+Ea3Z+qpW3M aciPoVY9TD0R/Kv9INorW/QB2BAz/QgnQuESnVGT/bbGohiiGol6vLdM7O2JY47kegr/WR 59t+yvHgDazhwPp2W5xKBN7OPx9eFS4= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvvdS74xmzwRlg; Thu, 6 Jun 2024 14:32:28 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id B4A05141177; Thu, 6 Jun 2024 14:36:26 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:26 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Thu, 6 Jun 2024 14:32:42 +0800 Message-ID: <20240606063247.712575-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 46C091C0008 X-Stat-Signature: osot3n36u8on5c9xojri6kr5usbcniz4 X-HE-Tag: 1717655788-333935 X-HE-Meta: U2FsdGVkX1+leUjdL1Su5T8TIvOlCL34Bf9bwVRUXmgFMMNRQjypWVKic1s5OzHadAINPLm4Q0CARviSNWLoBVbKXGZ2twqdVTOHLSp6n5FEZX9+aRVjQEONa7Xfq2qU3znrhMesXQFI6S04PhSw72CLGy4c9oAVY3EV/EDajj80z/TFrHTAyMQZp5nsbe6UR3Ih+juEowWk3D+jl+MfEzm7i7K7rouM/ehxbVU+11cftaeZh5XgBcqA8g4bwSs5CGEZ1sSkVbXKQpUenPrIAIwga2chTpONrBAsogbfLy900UMl3j2DZAm5NZcWSbx/KlkrtcRZcpOl9Ch7g4kZWOuhMApYW8DJAa+9gVJB+RzaJBXNkUcwLRP456gubWziPB9x1K8+K0ZVztl9suShNPoP2qNk92VU4uzo2uer7rah5og41NY0FtfYLw10u3UfYiM6iaY2UgJSKMBvQjNvw4H84J3xMb6VERNEILsqr0cNwBQT9nocHIn/cLLHyitRpfxd0eNZOObfFl7QluTMzFcZv4mGsJ9AYAze1lr0KDFivm+5avuRa+kLUObB71puP90FqA2iXqEd8IiD758OYnOOz+PrYa8IZexyFz+X7YpuiB86xRNvidg8PT+sBDxWGGWEJE1t6Z0HH/iDbmuZe0RufTRravuv8hNq/5HufIU9byHPBNB65QgLacRBd9ixW5hP5jsUAmnUTdIiP9pigJww1PfjYjrT4rCK8DAmkCM/WD9kQeN3YnllLRVk4ntYPv4Pj2Ub6cnpFBRHo/SnIzaBac419fJzCCeB+dJ0nOew4nDDY9W4RilppmVAisR3tOroP6HIIm2Cqt88Y+Gqs+9SbwRzATF3jTXsqAp1yeY+lwDUg4Zs98Gn21ftaQn3CaBpj+VSRAZVRjFvP7/9sNAnfBI929YuxTEkJwRnTvVkP/8rbuy9PiOKfIdQswIgvD0O3Xt1QCXyD6SrUQL l/zY7AvW I3zzAK0oJ1N3uQjFSn06l0jVKHrekdKQT/W6kTI90rpbWFpTwmUjdbt8RhdBr7T/FtHG4P/u0Vf43k8AgBcA7P/MZU0YRIquLDCyeZNRiq8m/w1mYbc1w/yC2iBdVVBCdusfDwbw5xgXyuRt83IW3sLxylQKuYYj5HwSj5im60PnQPhys+NXiUkWJz9C7DzqBfPaQs+pADQWYwSbM+fybKzFL/ltWwv2wvcleRpuF7DmDm5oVXsO/fw4FROb9/xFqT+XzJTjyERVuUBdT6FdK2Uw/wdbzpFB3xSiWbNqc2n2ukS0= 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 6e26b8b975e5..81a544df8381 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 Thu Jun 6 06:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687862 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 D343CC27C55 for ; Thu, 6 Jun 2024 06:36:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAAB56B00A2; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BEA126B00A6; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B8F06B00A3; Thu, 6 Jun 2024 02:36:32 -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 266576B00A6 for ; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E239A81197 for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.07.DD129F1 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf06.hostedemail.com (Postfix) with ESMTP id C15BB180004 for ; Thu, 6 Jun 2024 06:36:29 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.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=1717655790; 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=MMNo8TBUcCJtug5tA7QswZAHuIiSWu9bhsKJuesi12M=; b=ODWAvrcZedbSTcEUjbJ9oxry8Suqi9f6k4L+WVx10IV6QZRNEycd0aBQoILvDJjM0RGNCU E5HexF/tcqLAtAa9y7F2JOfDs4JScPJemXrtmygn44YUzb7JD+PrxX0YEVLOAme+JhXCsx h98pdl08PGylvEKMBIEvfr8pTH+JlNo= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.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=1717655790; a=rsa-sha256; cv=none; b=DTtUGoXurFIII2W0TPs2s80zFZESuu3DBOIDFY71zpEyyFEeezm9NjRn6Q0PSv7lESqUa/ tXianj8MiTiykvIxlFSkyCn5NT8QRi/p9U89E1uzLqELgBY0J//pPXqu+ODOuquOcKvwqD 0fvb2+Z4wDwQ3NBd3g026wSt7nzlomk= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvvdT41fvzwRlf; Thu, 6 Jun 2024 14:32:29 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 48333180AA6; Thu, 6 Jun 2024 14:36:27 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:26 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 09/13] mm/memory-failure: remove obsolete comment in unpoison_memory() Date: Thu, 6 Jun 2024 14:32:43 +0800 Message-ID: <20240606063247.712575-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: C15BB180004 X-Stat-Signature: ywo5gptu7grpuz91mwbwqgixqwi5uiof X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717655789-810612 X-HE-Meta: U2FsdGVkX18WYiLgi0K0ckeCC0VdnwO9yvaxS3mO5WdeTWbp3jlAEn36H3dW9DxOAuLiLSxjGLwN04raVadtgEYl5lzcG1ScOP0sktsBR834LP/dbnnq9oxGe+PsfOkt8imjNw25O/yabvVUn0ekqvBXMoeGsDxF7TTKBObVTof7QUWLCgoLML4529/quLNCga3st46M4dzNkvKKnUMWMJaTqXDWW6gvOlI/1lDvvtgdSpbOseNc7653QtLQDunVCGevctcaz/eY9RYO08ynIfG2jsHH9BrneGa6TVfRUD5TQ3RVnG58ByTOIG4qYC+e6fjo+ODIfRRKAFMOqksvJ5IwLo8XFRRdcCe+irqMnQZbpvyCFqqAxS/IIiwNC0K+1RiybvL10eu49dA+zJRuuf5a9Jgnvep3jhhWa+sdyB8pff5AjAzM4xNLs3aitr5cfHN2P+Fo1+2N0jQw7s3ZbMd7mRrDEm10VMyoW+T03aYs9Xf6c6Uo5oOnvrOG/v0KC2ZMgvECldJYSgq+1WbstB7F6mYDvOjcKjT8kQ58p+fG85rvhbEmKzllKeaVrdy3+1It6u+LytU/0LkNDS0P7T5msxbtTl1MBG+vHAsycPCuj/am2oPT2d6rjiFzF/AjQhwi+9Jlb8YVcUcqGVryNb1joYWK3rh74lMfcvQ1anvr9UGmKkYg3BUfsvlsDOZiSrjN0UpUjuVqDyB4Ttb13sIm24328L9QYvJg+cSZz6MK2ZIBXTFyaSnNjt5NLJdVd1eM34+LXhs/piJm5uG4A6I73goqoe7Rvc/rjz0b2l5SIWG9X44SAsGSxD1QCwDCp2UCWMKmvd0/l9HIJ0/4/Buc+1rT394ptA7Mt7oSF07Og9xC9SaU6xDJ1YPZogoS/NRi3NvSQnNj+2SsxeqfAPHTI87J8GFAc6fBs4voqjUpkDvizmBpugWKQYzbTW9dCKwvxnPBnqX6XAPakqM GBbenCZQ xGEWjAd9YDgpoEMxySZ7KJy7dQ1J99BQsIRDXU0Z2r12mcWyCRed5/qxt2R7qR4paZhewrE/Jena9Xl16yeUboPdBc+wE+TXSjuV/+P+PepyI2TAeBaWCh9xtJr06lu+5x513s6q6MPVARY3cXg3mP4h4hGgqXzIyAgr2bf9qgLuiC5WXp/4xo1vzS5PVXm1/k31ix3E0ThMW39wbofil/dEwOX4BcTGUL/KIV8Q//my0gaizPqoQur12a9q6hDyWqYa7w4XWX7bcyZ8En/TdOEMbMaURskcmgBpU 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 81a544df8381..51df2c2e0cc2 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 Thu Jun 6 06:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687864 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 CF263C27C55 for ; Thu, 6 Jun 2024 06:36:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 645FE6B00A6; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AEAE6B00A5; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 078086B00A6; Thu, 6 Jun 2024 02:36:33 -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 D3C376B00A5 for ; Thu, 6 Jun 2024 02:36:33 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 924ECA1332 for ; Thu, 6 Jun 2024 06:36:33 +0000 (UTC) X-FDA: 82199505066.03.CC04421 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf10.hostedemail.com (Postfix) with ESMTP id 34427C000D for ; Thu, 6 Jun 2024 06:36:30 +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=1717655791; 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=UbSSGkJl/h0lihJAQt/PGC0DqVALRCRnb/UFL6TRjRI=; b=Ug0i+Ru244MJeud2L9+yHuR29FB0Utghe+U5GuN8oP04HToGtiU3CjdE3mFK079W92Vwt4 zOjrWjnOTh2Bif39LWNJ1Oz0Wi1k4b2ZobjIGZu2uMj+SvGqkOgyfUIuwGnHx5mDvSQFGb y8dC5DveR8eGOxkFRs8fJniNnY2xHGg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655791; a=rsa-sha256; cv=none; b=5G/+Qo07FTkV0VT5/4CHv+9HiJG8/1sVY9jXgKT/9D3Qa9h0LGd3EEZ8NzaFOn3J46nfC+ wBsREhz/61I0UhAxC5Y5iZB0lmEGkF22sLC9mDhU1fxxvFcNqm13d9DkJwfThi8g9gZDM9 Di4Xsf4y5tkiWrn+8TTzCA7Yfd5EnIk= 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 Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Vvvdn5nT7z355kv; Thu, 6 Jun 2024 14:32:45 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id BC2BD1A0188; Thu, 6 Jun 2024 14:36:27 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:27 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 10/13] mm/memory-failure: move some function declarations into internal.h Date: Thu, 6 Jun 2024 14:32:44 +0800 Message-ID: <20240606063247.712575-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Stat-Signature: doco8u3pkd4g899zbudcdxi8irc76hob X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 34427C000D X-HE-Tag: 1717655790-318285 X-HE-Meta: U2FsdGVkX18xnHrcymHj+A/4VG+apVTK/EleQVqgYV2OU0RTCoyd05+HK3XQDEiD9QpZktRAcnzuSe8XyoUlDEOcNwJljI5v7GZaLf5nptbivjnoDgSi8CAEbWGwM290a3+SQOEvzDNrQ8ezmjMOp52bif0txkaLDfGINl66hPisO3GxatsLAY/zeFzFB+eUYFa1hIqYnyUZXCZ4nqR2vCzKFuxS104Z0ROyamcswtwRdITOp1leMkRzijUjbzFXCjF+UL3EAvono5U5eqTZ7W1IJp1mGNCZZCRsJnbB6G4IhHuAVVunpWhSmb+24zppuKftpqhpBlw+IG4029e3BkfZlpehZm2ES/3gwBMSYTQ4zbp3xdF8PdBlaD9kAkzIBeOcebR49WT9C7IF3c0pkhC2lkk+6+p2wGSgtM8dFjXUhlNCvxOQ4CPkdyKBWot9KO8e2HwEtjJKl7f7M83lc0BLcsFQWJH9Xja2VxsIWZZnWpzS2jWyf7k2uv//NivHUKjBRCgHYwKSu3mGiJvRhgm1E9Uers54jnhWuih3v6Rza6411xvS5hlo+xKmmjFMTjTw2NhZnrsSgq9Ej4O7zov6UWHIz8Tca9RY//udVdLVngk05iU2vBdVQTwXFWbIS41uRaIcvDgPbusb3QhYEdD4cvGwP+1LJxB8ZdcjYJjMOBa3gAhJnKVbjoGwB0AQ/Sr5BYxNa//EaO1vamZPhyaID2skOvSZmtChAdwMNObEFAOWkdv8tfqsLc9iucV7kzS6F3Bb5n9MMSQyJGJXnC+JmsuonaVEpr0zFfUM7QfR7vEpajI3+N1s/+OLhE2rQ4JflPPNVZWmsb+WbhF9/FHzrXYJzi511diKqwVzUw7A+RtQM9kO5grod9D2mZrhpQBmyRJa+U0/YkLMiHXIyYCFzvQDzII4R+j/rGcAHW9YFFMIhXB7Fk3UDLa4vEFjRJ8NE4ioOOTCsSpw3V+ 063O/JhY vTr39MWS4MjbTp3o1ItcfBYwNVKctfPDVuKeA7Zq/qEQkDH6btLI/tDckOvdbnfDkzDXFF/If0CrbV0REVWMIHf9CanDxNX5i8qTRMJpAMThJcceNSS2wwAOvxRsUErvGutPpEPj3QU0YGisNqqm0r58u5VZpuP//AMzZ99iAC/sbVL+pmsFmrQI4V6WW7MmBnGzN/OrPwIt/KvRrSnAYjKTkQy2XAtFhmtSZjYu9CY7OZI1ycQ0U//Ns+8MT5ZJehh+Wo241s7mS23/Jzvc+OdT2nDWeFIKEgX20spPOnP83i58= 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 ec7141fb0252..5ca79aff5e39 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4011,7 +4011,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) { @@ -4032,12 +4031,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 f04fea86324d..b4e3444f1d9b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -616,11 +616,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 0fd9bebce54c..8ff042c3eae2 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -723,8 +723,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 12e95fdf61e9..7b1368d14e85 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1077,6 +1077,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 */ +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); +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 Thu Jun 6 06:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687863 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 B99C5C25B75 for ; Thu, 6 Jun 2024 06:36:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EE6A6B00AA; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 200616B00A9; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFAEF6B00A8; Thu, 6 Jun 2024 02:36:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C80226B00A3 for ; Thu, 6 Jun 2024 02:36:33 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 755B01A11DB for ; Thu, 6 Jun 2024 06:36:33 +0000 (UTC) X-FDA: 82199505066.18.2D184DC Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf05.hostedemail.com (Postfix) with ESMTP id 51A7D10001E for ; Thu, 6 Jun 2024 06:36:30 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1717655791; 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=ECd9KSuR/kcZcD1R4CBEQsPFnj9iaXFjsw2Gzpf5Xdg=; b=dDH4OikrqbDlJMMTMP7ahj1Eurfa58CZTFymnpLhmjpHzwUdg1AzdGJg5LCfFdFtAXzw9J SmAp9UIPZTpIY+yRo7TOGOwGrQBjRaXmWUmZ/Uy0zlQuEbk6iJ7h8zXXcYvMEV5WsBFML5 +D9eUcuKGyqSDLHJe10b5huGEahX5dw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655791; a=rsa-sha256; cv=none; b=LeJVoOz5+srOVa8Ot0Dt5E1AMV8mSnH0hrT0pFEucnbQ66+7BQizW2BETQHRcLV1Ul+Env oMyA3rqqbRj0JG1vEOLKgS7YI5zDV2kngjgevPHFqSi38tZRTUFowjNbAnuSMIhtXDUAgU n+HJh0YOAelJe1Gg0c/7EtI9r73yyko= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VvvhR5XVdzdZNS; Thu, 6 Jun 2024 14:35:03 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 488EB18007E; Thu, 6 Jun 2024 14:36:28 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:27 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 11/13] mm/memory-failure: fix comment of get_hwpoison_page() Date: Thu, 6 Jun 2024 14:32:45 +0800 Message-ID: <20240606063247.712575-12-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: 51A7D10001E X-Stat-Signature: sar6imy5mhewkhdz3i97yj86mccnq4yw X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717655790-397925 X-HE-Meta: U2FsdGVkX18dAf7Z/+nHlo8ea8zAcEai3KdG4aT29xN173ghL8pr3UresJrOpJoKBMAd6YvYmNWp2tjUCG1+ovoA8nCu0QVqAgmQvnMqUMfWKl3cbxiEHNBbOvdNDrjM8fkweIWTHrTIwHou0829RBhLn1YHkPMINTeygGuCecAbXB2TwAlY7pMaRNAKzZHuFfFmk3k4+89f3CQ/5TGzlqeJ5+H1n5UT5wHyrXss+/d0WP5RAVVTRSrUyzPy8TmEcJR+/55baXfuUZ9AiQraPU7w9g2TSFtA1JI+zcsHvqP3kBQ5+7EYxpolYuxWBU4iAEkiL9/BjUeozrnyRJ8JeNkTKvWhLeETVtNFteYaN85GVovR8GPSTkWZG4v1qvWOiO/WtJ1IJUK9JPVpXOEQ41jIj5d/dnaTyQKkDtLjmNWwt95Eejueg7/Xl6lSqdmyShnOVRTQBFAfJSpjrkjEpoP/WR8mMiZIFXeKT258YJ7JN+vicztLOVPlVTZV2bw9q0chEDlfY/SHvXNXLLrYHDixVxgmNjngYacrZGyOBzma/rDoDKtdpPdu0YYadK8e7l7mzHN0LFKJms41OSivBOoArZc51qd69pWrgwNKtR2so7vRzlWh6ONE15EWA2ANwndM3ZN7VHH8SbUdWjxe25BYteHCCqF9/oU5x9qW8kWdTJDe1A4d/alHasUr088j3L0LkGL7nExm8hCXYlZgb3KFStWM6ipCeOge9KGUi42s+SiVu/KhPc5kclFeVw1aJThsgHUZdVd6bG3oINdNGwp2rd0XUiGkUmp0e3Sgz44+Fgj5ib+0G71GvC0qHpu2HeyW7dWWGMjlCREcwGB0JTC1Kvf3EFz0RXNiL8k+JwsjZZldtCRN67Qzw6qkAxMLlbIb5OlMSPRoNphcZeL0UqC2ZUjF/E5f/wlV7xN0gSP8rgZvyaDmOZWQWgrQWAn1k3cizfiiOyd2FvWqgac +KA24ALH xESGllPbY0je43g+/BPdtiEgnivVeOhasN+aaKX8cmI1j3AsrRxL456z+XUfV0uqdjpYxATS7CNFvYsd94Bx/QbL3FRa0DUFqAqPVlVRoHXte3rPWPxrOh1Ta/HVll/mgQ5tg0SRtDvet2wbl7eKdfEvzl4QbgFmFtAZ/puyElNBhdJ3H6bpshJ9xn5EVVD8hHttNTZdfZT9bNuPXTmf30xyvxvycsicCCOJlM6eFh8ZTMYyKan5om80NpAaDIsTBzUYl1+kExDFpNeA= 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 51df2c2e0cc2..0d37f20968e6 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 Thu Jun 6 06:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687865 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 225DDC25B75 for ; Thu, 6 Jun 2024 06:36:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97BBC6B00A3; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B9826B00A9; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EC116B00A3; Thu, 6 Jun 2024 02:36:34 -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 0A7FA6B00A5 for ; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BBF51A1D59 for ; Thu, 6 Jun 2024 06:36:33 +0000 (UTC) X-FDA: 82199505066.24.21FC707 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 9C97B140010 for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.32 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=1717655792; 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=LAtz7ewGpMSywGfrv7lAhKdC2g8+nt68QVZSz45GsQ4=; b=O8bFWagOuDJHHk9NccFr+D36FopIKwwAMuTg90jkNahXDH1Mg7Wxt5MUw47y2i9bbqGJjt aFpXAxwtNG0+s4pXk3XfpVk3HZj/SarBsvRroX60+XU+ILDXa2SHUlFn9KOihE5wIBcn7d L6PihwVR4KCwLC4G0UHP/rKhaI2KAQg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655792; a=rsa-sha256; cv=none; b=w8ks53e6tuQGQ1EovclkiFglXMfbuNNiFbAMaccsBdivx0hCRNH4JJlfugzx27TI4jXFKX 1ZCW5wDR+XwPt1SQ2phOwz8mUWEQemfitGr59S5UVCz2Kmfweuwe/uUBAXzNuKNhq877v5 X5GTuUW186d3O2et4g+g5RZI0WwPlU4= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VvvhX1wr5z1xsGB; Thu, 6 Jun 2024 14:35:08 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id CAAE21A016C; Thu, 6 Jun 2024 14:36:28 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:28 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 12/13] mm/memory-failure: remove obsolete comment in kill_proc() Date: Thu, 6 Jun 2024 14:32:46 +0800 Message-ID: <20240606063247.712575-13-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9C97B140010 X-Stat-Signature: ppgefugaezxnuypadfmfmgi9p49qsbcp X-HE-Tag: 1717655791-868009 X-HE-Meta: U2FsdGVkX1/SJwkY/XduUh4uza2o8rDYmYOT67g82IUVM5noBuyuUtBKNrhAix4yKSN2lppzaaA1QAILGrKhS2GJJ5SlA58CNwvJRMzIDJQTQRmRUfzH/tbumnFSTmUAA0ZHlsAlEuZ5dNaKE7IJKQezs97fJVo7gCwlOrtdQ0jwQyxPs3csjeUHodVekDa6svqg9EH5IAIYGVZhtvCl4sNss2/pBj+S+94TR4RIuaSsbsmOENUd7Q5AHHitWA3Ajc/nS9aI4TtM7OAik0PQOXhNuyfiB84eDXvRaB6iuGC9WTI13glE/2P0Fh1gUoJrl6P8rpHug3WC9i7N9BV7P0tj8VSAD73vHhxt5XO0aeU6DsOFtjW7om95tZuvpjRHCBnIhAsftLT7+L/4YpBFIDk+zFoy1eO0bmLZfBPvExumEtwXwBhISk+8jgcKwhbZHbI8tKWlrN6jQOMTDbDPJzfRJGXqE36k/cV/Zj+hV0cnQPu839rchTCLnAUnwW6KiK3NyIJHaC8PlbdFGsawhE2UvGZuakX8G5Q9QTI+gD/4CXSFbK++e3DIe5UrPlufLt2R6fZsYzjOuVqshhHz1xgclcAr0/mphwmAmH4rTW4u0I3g7LfNFkm0UVaXFgSI9RXkkraOwVqV/lb3ayMkgm2AM3e8619ttrenJ+lv+hyfRmE39kjKL4Su+WF465RLCXB+mWwuTuCgS0atOYN4WGhVUKOBjcLJNmhbbeLqghEdYd78eP8C5snX8H3xDuVHON4eqeJs2bmgtWHLHa7KGR7OH4aicAkKgdVUE8YWl8r8Yj9kPdLnieV0nMeqhdIJbcEHtTr2qb4K9K/JLNX8mISeuKMwKTqe8iqTH1Xd4U1K7hSpXIMl67ijoAKI/Ox47YFPgLvlfe3yHJoVjx/Txn1gE8wcUneZVKYGKoWDUoFFgf2e90qXFKHQAGXxmhf72E/M0r2W+8MycVRTlJC StX+WHMV dEoESJ+ihE7rsCfSPPjLUvsE+sxPOQPubciWM4JTlqpOTO6AJ2Fx1wUFGJsDpBx5d4Dppjy1gof5hhRAhqEq+uXJCq4r2V3YvZGUrtOEBXgJu49R27Tb4kXlqRJI17ESLctFfdX2fmlqz937d7DDtykCpeVWtQdIG6AF+Qwdp9jXWelsQ/6EqJhlt5YI6azSSVmN5Ss2fhtVuWpmZE0HwcmMHQ8OCSKSRSgmIfm+orpPBZpq5Oi4xFbx1tnvbblCiT3X4LiVRkhbMybx0Vl9J71RHqqEI1kIZzgYe 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 0d37f20968e6..161bdc79b44c 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 Thu Jun 6 06:32:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687866 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 0343BC27C55 for ; Thu, 6 Jun 2024 06:36:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 311AB6B00A5; Thu, 6 Jun 2024 02:36:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 273FA6B00A8; Thu, 6 Jun 2024 02:36:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13ADE6B00A9; Thu, 6 Jun 2024 02:36:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D84766B00A5 for ; Thu, 6 Jun 2024 02:36:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 945761212FE for ; Thu, 6 Jun 2024 06:36:34 +0000 (UTC) X-FDA: 82199505108.24.32C0C7F Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf26.hostedemail.com (Postfix) with ESMTP id 6BD94140004 for ; Thu, 6 Jun 2024 06:36:32 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 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=1717655792; 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=2TRP8tL1Yx/I22Rea4z0uz6ILpEulqMsf0oPfl2E+r0=; b=XfFCKlM1fOdDnfMGCELmnthTqE2qdJnGFE2kCFxrrypQZFDdYnKhJuf+YUAPnIZcXdImgO NzY0kW51PnJ3GFJBG5zsGWAr4ljlyxiV7mkqzNgX0xrwzvrRpndePjdr0JCEjDzBUjOZ1y yB7sOCqKXz949lgGepj0bQs5VqcCTVg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655792; a=rsa-sha256; cv=none; b=HtZ76i5uE6UXzGgFcdbxhcpBh+M+IP5Pr7oZIIqsvqn+IiBJxefhuMG59rcXxntllyFKxz 0pyGbyAnV6DjUO0lfS1DbkjaR6fo/pTpd+SgQfIO+gpg49gUh6UD3nn0flPbi7bQUbAOcc KBCCPBh9kCl7Sbum8eqw8h1NI2Vop2c= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 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.234]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Vvvdp6Dc2z1S66Z; Thu, 6 Jun 2024 14:32:46 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 58DFE14035F; Thu, 6 Jun 2024 14:36:29 +0800 (CST) Received: from huawei.com (10.173.135.154) 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; Thu, 6 Jun 2024 14:36:28 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 13/13] mm/memory-failure: correct comment in me_swapcache_dirty Date: Thu, 6 Jun 2024 14:32:47 +0800 Message-ID: <20240606063247.712575-14-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspam-User: X-Stat-Signature: h1sjbrfextyw3zjw54nubwzbddu1ceps X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6BD94140004 X-HE-Tag: 1717655792-36441 X-HE-Meta: U2FsdGVkX194daAhQtsQFEQmi26r5/6H56scBdVyNxWWVc8IJG70hL0y6ZgQds2KDraFJmmYNX0NsfB9WvJZGHjCL7QLLw9fp/3Te2MB8I3hM4nqJdeeJWu9KTFXOAtxf0LtUBwimYsCf41NPB24Hog5tRu9mo2O15BWVL6zqSo91nhSTpg8Bf/NkdhXsLXIFQOXpviwk5c6uiNQmR+HCz0RBNbuESuFNK90yMun1SbG6r/3ozKP6m6IBpTgMU48/FdK5+H5WggPAo6dLgtd0VL2+Zss5/tizzuD6BjctMMOMJe6qe/3g/160hAp+drnv9sARSOEP8/a29YAhPZ4+IIx1pTnyTj9BbnSi6thBdSMKDxn7Y9x/qZommv0Y7f7mnN/t4VQL/snBJcFOIukgvqP3us4HYhl7zHK7L+UzmF286tRD4YFkrpuyEbWYLRWLjUHS+ytZtlSS/qQ0Yfahr4JoOlc2gAZG7HOFI4FGZKhVj+EtjMMR1v4N+9cYj6QT62bk3+ByccQVRmokZPmvXZ+TAYo2oW8dxtgAbhAvEM2e/d6za/skCkGZImoYBE3YMJiqXCKOxB4Ab99FXM4dVIpo1xJ6uyYnN2CVmew0lA4ou7XynF6x08UZ5p5bVA0CFdQVpPrlR3+8zwmAF3mXwqPsn5dkvCa34uTbeXc98Wz5/KcvGAc0grVWKqR2tDbFDvo4nI2Wn7tyVI/YJDUgSlE80XcatoqgkemX05zW2Gs0qVoNM2eKkywrw0cSYu5Hlcg22cqFrALSsMd35PiXjlqdvZ1swLjX8rn6cMrTbVpI7UCdJQAU8AUIC9p59lN81hyO/qxuPCAwyARJqmJqj6hcvd31MPe/B4L8VYtNAqp7OeXAdcbZsBcrrTKJYU/nGCqxlA5ytH2nmYpcDNFpJPUsKBX3JBagHlSWPayfBdRkgNLUz2xXPIExXR4sbNV4Iwu1M1/Hho1Vr90nJZ qaEWQYtk 5zzjiIJfTBZNNTO5mEk3wkNx7couxQ8e+aiNLKOLCMx82Q1SI/uAFCUth9DvGmWALgMycYRL3/kRPUfbH6YpNaBjC0lNJnsa+Z5AIkJYUOCSxHxUKjYo0oCVOc5pCDIahRE+sFWfK9CzcxnH9+iBLCAg/PEuAYdDtep+YDRuFSwd7wiElraqtcXjfgMxyLqm3FENTHxBAYmPkNiXm8Hu/UvrpxsyozA9cPfV7XOmuD9sEeIaDAla3rc7hiHyOvOLbcDduCzkvmw8WqMQ= 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 161bdc79b44c..4fd8ab8fe3b4 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,