From patchwork Fri May 24 09:12:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672904 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 C235CC25B79 for ; Fri, 24 May 2024 09:16:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE6196B00A2; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD48D6B009F; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A27DB6B00A2; Fri, 24 May 2024 05:16:35 -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 614466B009F for ; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0CC9C140986 for ; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.18.AA822AF Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id D63CE80002 for ; Fri, 24 May 2024 09:16:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.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=1716542193; 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=S/XFvnhaSV/ShKjy4j+7i2CKc+skORVi3VnJx4KmNHg=; b=qwlzOtOwiMNjiTs948Lw0CLMbSlQ/oET24sEI0DaCiwgXl4RHqZGp6QPJBjMW9X40+8JUF 5rAEUpONPlPzHw4zL06vXLZcu87hydo5cc1n8bDDUiBXJnBrv6irIt97HwSANz2oiCca7G 3k0Z68KYx4FZYrlSM5cdFBUCoqS6R60= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542193; a=rsa-sha256; cv=none; b=HlYNBblk8PZyisGwhV8X8qVgR7mV5Z7Ftdi+SHraGauJXyCshN9AJVOLkXm70mnW3ezSCX 9vS4YCVu8byrNGtU9jHSKpQrpN8o2elQMn7jCA6mxIO/5ScskbVZrZypS9tQdfejCAHflA FoOHYmpRxuYvdYfIHbrAYlLmzECjQwY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpM0QJHzsRmy; Fri, 24 May 2024 17:12:43 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 9C485180A9C; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:26 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 01/13] mm/memory-failure: simplify put_ref_page() Date: Fri, 24 May 2024 17:12:58 +0800 Message-ID: <20240524091310.1430048-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 3d77ar3zq3bweywysgxrab84z3kkpewd X-Rspamd-Queue-Id: D63CE80002 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1716542192-680341 X-HE-Meta: U2FsdGVkX1+q0+vaiGUV7fWdpkUXBZ8233HgbVG8c/fL4u+g4fcZYj3Yp6Es/S6CMttzw04WV3DmZUFfbGZN2E8TBUdqQcs+L89eE5CRDPHdUNHupXurYDFGoUU5KRjOhRR1jfn9esSFUDpkirMAxNMpZ2D1m+ABBlTBDE6d6kkj/T0bGZNT6TjMnQC2u/ITIXODCdJA5534fvnD1jvKaGe+KzyvAFEbQZES4CgY00JMhwafwv/TxrMqxSqbCMnW5apLxA0XPn6wV2GVUgmqb8PX00FmmoqwzTQsRaoBh14YszZv24Vc15YKjkC3TdJ37PSU0luCbJnLUWZnyu26x7djdKultQk/qJuuFjtk9Un6dzz7vFvrXHVHWRB+nQ26KKFrg0zjdvmlGKILnzmFs0ecyIGpwc/ushkQZfziPnXK2TzTfEdu33QRZCek4t9LyB7/EZxhIuLD92km+dpM8SDDLSq/ti3Lc8oRKUKgUGRyAFQh3F6MzS6tGKXXScoFOPzzlpVcdt5uGpEPVG1mhmZLH96bH8j9SBgfcBlfM3sMB/gmXWX47slcZ0uDfbGQ7QdWuy6iV84GKX+g7N0xr4QUY5T4jZAx90RPIqdJnsGzpaiE3sWKjkod9GQ523fojlyHuaNVIk76hBc+t9Wd+O2m7rmrPctioGZkYNFFbs9tOMhgAEpkK0alwsmj+bI0VWC9JFVeTrf4cndTNJJzAltKtkBdpkWqlda+KK+Ut93/S6kjDG61PtgMLy8jzrMT7/n1i8fWPFLU+UW6yr0rXp7W2I2OxiN2wGdxODvMIQ6fWxhmE+vuq/cBfPSPky0Ah0hrlJ93/14hlGnY+6yc8tmleoy+JE/EeCjWEfkl3TIfhzbvYn4Ly7P9iYbDiZCafz+F2B4lbv22IAQ2ytCDEjX6rChiKwsrxykJsOgAW6TI3CEJAY5AotABfDtDjqPVn7XfAyxUTSA7sLeFyn9 Cbc9YLFh qmUHbvz+rUrxW1zT/vOqMkwjrFPc0BiWQ79XqHm52KTsKJARsCZgT222nyVw03YPJH+3lIb4jfNBW6oHGR/Z07Ls4q0gcWVGmBSsqQJre96CLODoopdVRgbCre21/x6B9zwTdriDpB1ozCXyuHudrbQViXi8Vr2PJB9BVNPx4VPXdZYxYWe8dJuNbX6ulwQNlqX16EvzoQbCf/TXkpPgvCWf1ig+VNh5NRQEutSTQ9dfUg5AsWeULCPGbGRDpGTNmPee7DTAx1uo8VRY= 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 ac030061eda0..922c902a7229 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2150,14 +2150,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 Fri May 24 09:12:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672905 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 13548C25B74 for ; Fri, 24 May 2024 09:16:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DCBE6B00A0; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06A796B009F; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A99476B00A0; Fri, 24 May 2024 05:16:35 -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 6EC746B00A1 for ; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 16240120280 for ; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.11.71024EA Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf07.hostedemail.com (Postfix) with ESMTP id C703240010 for ; Fri, 24 May 2024 09:16:32 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.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=1716542193; 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=uO5du8JNulPhowiQ+ujPEZ3NXy18gcO1MCd5MkfyIIU=; b=W0jZ6Mi/aImSeL7F3vTjAUZlh8beSKNx0cmSfyXYn7tkVZGstqljcRUEolnUbcJQBzmIBI LywVeMF6O/LarbQgcQRobb5wZyonEHZRapl0QrMPO32WsDYRPatw7T9JlunQVOwPX+er3g 9kyTINxbdMq7q7oTG1Cs+RUfc+zj3HI= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.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=1716542193; a=rsa-sha256; cv=none; b=B36KEzw6qys48t6tGqB1HW4JpzZv1vkb9H2jIRP1CG1FbK7UJUUT27wq6xDx13s71bx80+ t65hpmTLYOg55ZXX0xONBYy1mlC/rKiwLNtkkBUHHaecrOl8ZMsr16xNfWJ+fN0iWSv929 otuh9eFtjJdNCkkBJPt2UEwJSV8BgX4= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Vlzs84TXDzcj6g; Fri, 24 May 2024 17:15:08 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 2275F180A9C; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:26 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 02/13] mm/memory-failure: remove MF_MSG_SLAB Date: Fri, 24 May 2024 17:12:59 +0800 Message-ID: <20240524091310.1430048-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: q3xfxehntxm31cn334z7qbqwqxs5hc3p X-Rspamd-Queue-Id: C703240010 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1716542192-613327 X-HE-Meta: U2FsdGVkX1/4ZfMy1qW8daMX22iFh9l+s3/GQB0/iu+NmZgL6syjVGHJHV6bVURZJ2PvIh8+Qnxpd6Po+hzHYHYKd+gvMAQNJM/C7sO0JxMrcFwxlG/ZUrlXXVo/KRNs2xi7t3l2olyBHam5SekHjs/El2gbHwXhV8/3x8NCpsN6+7eW+cnVVdHYwV2Hlz0cXZ6F8lGki9XwLCwbOi8lwEQLVa/NxvtkF6nEReYrFP0KHnCi+k0Fw/OYKQ3ZgJbFYqepWXn2qJ3WSW/DLjDVeb2JRwUJ7D/C9mSC8EIS+1OIJECoPXsURRaJTUUZ+47E3tT8HXNOtk5Q59FrUzOvZZ52R7hAuq8dvaJEaBQ9XdacqyCC7SwwR8e74ygSpT2+jl/lRm8qKyNFYPcZI0z1XEuYWpUatPMUlQacibV6IKqOS464hDu3xPoiKYwp/juM4Y76sQPkyfa2ZzRFJx5hTakEWQwBeYlimGDd57gL2aovBTELMmrcVnjRUXDo8CZTbvLr7crI1mdUdRDdSS+VwD2gJ6AbtWJZS/fsuCRKhX2sfz0+VWQjWyl8AUIkh0QuVKHhzam+cPXPHUoBgoyWMf+1hC0grCpiuJa56FkRwUl2EIsGqpe8JAnAIV9W7iiQY+nuOfRtwXEtX4iXLCuUHg1JO4uFyP3M1SUkDC4HFBx2llTLpagXN6vq97stVt8JzaN9HrvnwGiB44HLHnjoMFX+X79/jefAWif1HrabxI7k0yD6rtIdd7j89u0UGyChn7wverWuX8q77i0j38tibixp+w1Z0/fJm3t1uqPl+H9ivhdmNzPO05Hs544itYIcHDJq6oX1jQMqAPCLBeoykLm9IbhhDZphuZX+vyDEaRNcjWpj86XuVLDeIWSkW0zYReOacWT9DFOIRR1Py3ZWnUiZfNdgAxZhmGFtiOtKFtraM9KCj0oUA9rnmMHcDZE5Jc42qakrm3kmkMmd14l SgeYPMp2 v4G/2yALHIACXwvtOBiCTAietE2+Fw6TcQkGCyFec2C00dsHo9OfxK81hSbWE5zFn/M4sNuy655CCcURSr+DZzqtKQQuudWstIGWWpx9nfm2EfhHfOIgcxjmx9a2o8BCJsR6jGaLJeeO+8Nn+wR72MxqL98U9a/TENSaAg3TbfzU3NTUD91U/W3DeUK2CYiSRTpOZHI5ZGBBDUwlcSf9RnQUKW20x5S5ZgD/isUmtVA+wrcoBkkSDn5XVyohZQXUxa5NPxdn2G1IExsQ= 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 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 3aa1b6889bcc..4bc97ae25ade 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4099,7 +4099,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 b3f6832a94fe..3fe77ba2cdd5 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 922c902a7229..9c23adceee75 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 Fri May 24 09:13:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672900 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 2393CC25B7D for ; Fri, 24 May 2024 09:16:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 652E96B0099; Fri, 24 May 2024 05:16:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5425B6B009B; Fri, 24 May 2024 05:16:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 283D76B00A0; Fri, 24 May 2024 05:16:34 -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 F2FFF6B009B for ; Fri, 24 May 2024 05:16:33 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A06141A09EB for ; Fri, 24 May 2024 09:16:33 +0000 (UTC) X-FDA: 82152733866.28.F1EBF4C Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf29.hostedemail.com (Postfix) with ESMTP id 7A9DA120017 for ; Fri, 24 May 2024 09:16:31 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.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=1716542191; 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=vePlv5vJfDtt13tD5NE8SAwiC4O3h+vsiWw+noK3XrI=; b=AMCy4RZKwowrPGNw7qUWj6vY6lOz/kBQS+ud7SIxmxdomq56qayziQE6CxffTWRwi+Ewkt SHrTc3W76e5TVifQBvcMfScH563uL3IbS5DlhqUgRqfODwUTkvykLLg6ReTJRzvePG0vx9 wnJbeaGJ0ybgrD5o+Dvf+jRNhLQ/gwk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.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=1716542192; a=rsa-sha256; cv=none; b=Dt7NR+F3PCN/1Sv7axPzTK4KVt6rsV1siiehAyR3f7nVuTuPvPy74YfuLiR9eqfvD0jTLe Pc88XlDSNGvmLTxrA44/EiE4pRqDnovJ2K0UPsjK+IbfoZxSeQnLNcfYC8qRdtYfnvXpS0 +3KZQxXPkgRUV68nK453Z2jRx/pwFjA= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpQ5VQJzwPF9; Fri, 24 May 2024 17:12:46 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 8A84A18007E; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:27 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 03/13] mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM Date: Fri, 24 May 2024 17:13:00 +0800 Message-ID: <20240524091310.1430048-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 7A9DA120017 X-Stat-Signature: ib9d6m1s3ws59bsuiw6dcwz31iap8nyp X-HE-Tag: 1716542191-308569 X-HE-Meta: U2FsdGVkX1/lkxF4wB0Sf7k045MJtrax66F8J8xY0csN9GK2wWTVQLw5qi12ayPOe4Ono6KXQAwjv1YAu15YB8ES1Zwjh9ZkARowkvEb9E/aGapxs8nzkPtfKZmNDTe70Xq2Hnoe5VBtRr/y0HBO2cJQDK5h6EcVTQWp5uHz9NPRDpNkJFSld8OH4bI2kFliASy15AhrsuvlKvGsOSxBeMvdqj/h2IpJgETvi+Pr+YQFazYLdbK0oKPrR5gKr9rOr7dHT0A1nZUOSIbR8UB2K/rglDAdPbF7a/wjbZ1hUuvuKu9IMtIisR6yesNyUi38tSv3YfpWz8GYLLQJdh6BdA/D6jYs1IOX41pl2J1R3Wu0DxTsj8RuFWEZuXT4UkQ+lR7riM+TPdloFuhadFhumccP2NwM4wOaAjrDgJcLJ50+2UuT/itJS3etQa05245kUUOFC6lZthDQUMEdn74V9otIuZsBkIe2+upa4PM7/zn6auJoRZD8kWkREO/L8PQgRiS0jLmR99nsodf+8i9zxH87Zz+KtX1zeB/Oj2JvIB/p9Phbd/FE+rrbNaHl2pL80BveNWPm8VguBmjtJ8m0lKcyKQEv/20qEKuMdCXCek4meCGCcuASCaWWEsuS0W/XREwGc103+St5kYsYeABh+cTR4XLI4xdo66c0j2jF6dyqGGNUs/QZ7E0Q0pWjaZ/BK/LT0neOEoUS4XMWQ15ELw2TgB9onU/E6yV3Zi2fPrqS9etiKFaX8JyYLOAhPpoNK/ENaAFpAAaOKKJS77/NiVNbXQRIQYA0liXkG7s23lj24RZIGFYrVmt+eHOhQZPWikdO9Y0gut8b0zta/MleImWHYZVDrxwQtA8BFcfj9W653IC/6bXVHDdTO/XnxhvOgtCmvRFsc3kzeXXu86MiAIKznIAvXx5a85eylNKPYfUvxg6lvEMvAOBQh+qivL7sVHLkmMyI1Rn1ET2xvwH ox8KB6Wi rkJwntFLdcgItS0PDGv5OAsm7+AkAw0bcWCSxHimclpXrSFLnAzAU3yTeEa1f1mNE4wTvzjwy91N76bt3QitCeoFSySU46ahSj3lSWkNADoqy9SxU5CdhMROzNoJTozYyTfM97n2itp+PTIZhLmNBrB2S/3ONdNkR099tuvA05ng/271pLUF4T3TrtPn34rwcDVgt5RqJM7m4hUy3b+zyhFZy/tOKYKLIfa46HFr8YzTs1LARBZowTYiYdLNbdFHsZAbv195ln6mtD0w= 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 9c23adceee75..b571aaf987a2 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1446,6 +1446,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; @@ -1460,12 +1462,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; } @@ -1491,7 +1493,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 Fri May 24 09:13:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672899 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 CE63CC25B74 for ; Fri, 24 May 2024 09:16:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3DD426B009E; Fri, 24 May 2024 05:16:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 346416B0099; Fri, 24 May 2024 05:16:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 108AB6B009F; Fri, 24 May 2024 05:16:34 -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 E636A6B0099 for ; Fri, 24 May 2024 05:16:33 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8A9478090F for ; Fri, 24 May 2024 09:16:33 +0000 (UTC) X-FDA: 82152733866.10.D6B7636 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 72D001A0014 for ; Fri, 24 May 2024 09:16:31 +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.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=1716542191; 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=Hm05Nwo8Vmr3do3O5qo2gZB40E3bsSTaOxSb5JnkFVw=; b=oBFNp6YM/VLwPCNuLZ4IOLv89ktY2t3xpBVFSiC/8YsPUt3euQlfpxxw0izKFKO0GP2yXh SCxJPPqed37fjHO8SOCY2l1+sO4i6YrrFpR2g99E18glPpnWd3cvZ/FEYB62uPgCiizIZO XhpM7d9RkUHh/zVKlaVh6eV71NNXZeo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542191; a=rsa-sha256; cv=none; b=WCQCThS9xBzHppAGZF+1l98L+g7D/FsPJi4q1WQQe0mHQUzu6b/mY6y4hBora8tJEzpj7X VJ3MZ7q2VcwmxpGWnweYSyVGsDUQCk10pCnAPL8BHnqJkcRT1YltpFGQDTyVIk8iayw+k0 p89Zr6b6ez5K6U0AFTyrMCV1hs7/tcg= 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.32 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VlzsF1LTGz1wr5G; Fri, 24 May 2024 17:15:13 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 0C1881402E0; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:27 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 04/13] mm/memory-failure: save a page_folio() call Date: Fri, 24 May 2024 17:13:01 +0800 Message-ID: <20240524091310.1430048-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 4h8pkmm63jgb478iqusqwfs73hkpc5xs X-Rspamd-Queue-Id: 72D001A0014 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1716542191-619742 X-HE-Meta: U2FsdGVkX1+dUfcrlZ19YHPxF0D2SJWk9uqdMa7oCQqwVwupDKS/tC3moVd8Pee+ukizPZyMIOKsks+ip5iZhJlQ+fgSUW15uapVMV9Sz1+mHQt/B6R4V8QCZbDVdGhpXon91OJLUsb3r9ptp7F4t4bKYo/6/hGKYjT8zK9ylJkVUslUt0E7fzdbSU7e2QU1oOVJ9fjFSxg53DAE33bnAeDJAsvScJa974QjKmDyBc+k1TIfOxzYhpl5ZrIsHOSXUI9L6Tnh0DmPvwzEJogCQt6C1YkvBe70RKCc7P494/Hb1LKKcXgXuprbCpHps647cogEpGhX0xIiOjT2+XKan2zCI5tXaF8SiFYV0EOuFVtgZzY9jw4a4pKaCY7/KEAjhVjFTyTLOl/hCeQL38t4hGNY86rg8h6Z0Lu3EzkaXEQl4nG8zVo1pEPKwR9B0DAoS5hnjL7GQXJo5AyBA+IovP+XUmbj9Jg7Q3rGx5zzc95S7DNnwcnh+EcgPG0wBXaSIrAvgQpk2cPg0/DtRM873t1dlr2ekkWRbYWLlSR2hDq3zhuVN6afncN5dciIIuKlqSHLAbP4JIwPmhnd9Fx9UOROcuV6IMswMcs8oKlrwDNFJaCIGqk+/sfLokvbogyNkDHNiSeNHUqJ8shQCR/CoMwNWxACldbgz2O9Ph4Z/8WG8g8ORIAxtP6RNN3H61arb1H+8wJIJTeJA02Yg0xZcDHWqK6a7ejgh5G/skTKWSuMapGVFFTZNk5IaXQoKODLEvSG7x03XHd/W2OSaibJe4jynPfQt97gMVWVc1KJdkV3NSBeBAeJURQjLLnzm2tC28vL+Gyo1R93/TWDCQQ28kG+vJs1L02T4lDWTUj4b+ihdw1aBEgxUY2KJBCtI4bf2bIROCrp2vq/YnmEel6eiw60M1pGFJqsgWPMQRk0x8rr31fuw8mNvhJKzYlDzW3wcdg4a50kuxA= 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. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- 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 b571aaf987a2..73878ecdec22 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1658,7 +1658,7 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p, unmap_success = !page_mapped(p); 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 Fri May 24 09:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672908 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 BF591C25B74 for ; Fri, 24 May 2024 09:16:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 262596B00A7; Fri, 24 May 2024 05:16:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 044EE6B00A5; Fri, 24 May 2024 05:16:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEC166B00A6; Fri, 24 May 2024 05:16:36 -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 698706B00A5 for ; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 22B7B80489 for ; Fri, 24 May 2024 09:16:36 +0000 (UTC) X-FDA: 82152733992.21.3FAA30B Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf20.hostedemail.com (Postfix) with ESMTP id DDBAB1C000D for ; Fri, 24 May 2024 09:16:33 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.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=1716542194; 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=nhg61hzefL/Ak1dPcWLmtLW3k8QGTPT3J2FVlcb24Hg=; b=GylehuYyiYmU9w1HCeYQCCbFVWZo1aUlgL1iRYUpK51iC7lhHTVlWOIvshjsBhIu6Naou+ COwkOVP9iNVXAupof37Pa1e0kGDPsBEvq72VCoC1Znp913T20WhCk3cRbGkTV4Q3iiLu3X QG/LEFUP1GGRbLJvdPMq/vU2MYXDMcY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.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=1716542194; a=rsa-sha256; cv=none; b=ZRDd9LI60yduWFB6EQoSRbEhulKuqzJ59hMI+4V9bK/jfgFDfRJwSeCuvL728T/xM9/ZE0 Rc9gaAD795+gcvh4fE5MlKCVASdLFDG6yhlKoYK6GtDQJotUkglHbeHN26P055lmh5l+Eg rAskeuXmIwQcBaxc+DEgAD+0tRvXTa4= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Vlzq82b8VzPkVR; Fri, 24 May 2024 17:13:24 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 8C739180A9C; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:28 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 05/13] mm/memory-failure: remove unneeded empty string Date: Fri, 24 May 2024 17:13:02 +0800 Message-ID: <20240524091310.1430048-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: DDBAB1C000D X-Stat-Signature: ix74ygz9sztxduch5hbdbs4nqfywoe49 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1716542193-982136 X-HE-Meta: U2FsdGVkX1+ItZrEb95tgA1aF/ZfXL7t5Q8dQi07w2tvKLYaMdMtKzbHvO8DvBZ54NTxTEsZKU8aqnq0pJz8832rrQRynR40yQ8mAkm17A2FAh/uA409wqS70iWqL+p4KzCMdJYRb1idLlNehCkcSL2H7Xx4jHDyuOzv6GYxudtmZKtKv5A5ri1Qjosge4i1qQNwyEFCUK21ORAtXiMFkdQ/iuW0Agxz+5m6t0gzInXWds4XBk0afbSslxCWajrR1OoZcCYM/pXGplRSzgqRr2XTVzbS0H9c+544a0axJNmoAiGKF9n1oZTI6VTy3lFKgqie2X0roDa51gwFfdwcG1tiGyGVe7OLdRaEQlCfu4B18PH2wxG3KO8V/uVKNCS+eap1LLjRp9rkm12SdWzzIbTnwq1wROk8lP5oKFMrC2zpZFMKL0OVIhwMKT1sTeDTod0PfDQDWOmhc6dKRGmQuLrEjLoAiBTQzj8IxAn3WfoyFAjBWVQxpWeM40PZnlhBLVsV8TGRSCeN0Yva1U2fQIcv3Uj0OEuQgSNSZ+tnYaCScer05lqQrcEn3tURlH2XJCb1khVoujM9QU2+rvWhOS9SXfiKamUAQybXe+2xFx05d0z4Gczf5yYMfXTkxxo9nlUr55ibev1mgxL/SCWSCWjmFyOSl1NfCbJzpGc0ZSaSWtsY1CEh0EapYc4xjWpzfm4ofMJ5y62xsktWNpcgAtJV1px1aH41dGF9P29JZQ0N8bD0gu9IWfNoffjm0Btyxgf70rNTouikcznbBcKYFCIJ/81YZEQoG+wwyOjittOriJKMOYxe1U+pgOX/sSwOjwXqlvpQQTdxWDLMfy6nQiCSW5K3/TgtYXqQ339tuB/2t2yhcsql3LqiDFY+pSQgpeBr/BzmjClyJFsGq8FxPOqdQ8Niai4bFVIt1cWDedFKSFA/OjXX3eWdSQUqiPTamj28sodQFWuti2VNNPi GS+TDO8s 36cYOXRVHe9rgXWYqpqTPR/4Dq0l0t+w2IUeEX9p7ZygQoZS5CzcEcHggEdCFlLvvByMHi7GcIXABgOFnVWFzTY8kfPJhF82E4W6sOiYkza+5jG3HMfYjFCvi5QKyQRTDkpofbEKEGXzaoH9mVSxdzALY9KBZTB6aNX8rKkyapEFwFq7EfiIsDKqWaZOG+OlPPZIgMh6bBmn0BmkVNRnzIj4JaQ== 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 73878ecdec22..c09e1bf83682 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2549,7 +2549,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 Fri May 24 09:13:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672907 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 65B5AC25B79 for ; Fri, 24 May 2024 09:16:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7C156B00A1; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 93CB86B00A7; Fri, 24 May 2024 05:16:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 543046B00A4; Fri, 24 May 2024 05:16:36 -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 2B34F6B00A6 for ; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D867B40908 for ; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.07.DFAB654 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id CA12840014 for ; Fri, 24 May 2024 09:16:33 +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.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=1716542194; 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=pIH7hzujgguttdOeBjnoTLQ0m/iRhDb1xfprsdTohx4=; b=CIOH1RDF3FSaLHLYvxX1VKr5KGM7Scj2nYZu3bcdZGNnsQJIgjsU3aaIvmHJ5DFG/3dcGz GsFpiw+fkvmxp0zsIIcBFxOEDImuCfgU/U6VylQK7mecZMU0ddtRizD94aZZRhS1QlTx9e wuviLcBylyLZvN6idwFqKpc9ec8cNEc= 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.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542194; a=rsa-sha256; cv=none; b=Xu6eDoJuvyWu9u0PrXs1E5y1OvkkZJulw9NHqqNd/ikSEifFItVzJHm0GCTCyMGjsH2a8+ 97BZzfhoO4ZBUzIAifr4zh6BM3M8zZrYvp/HPEruzqw3+kUxLj20R4ZIk9d+u49ybB2aEW Pu+Z8GY4BUUxkwR/jNeLqHQ1q3PoDVI= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VlzsB3xbCzchZC; Fri, 24 May 2024 17:15:10 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 0DD9F140132; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:28 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 06/13] mm/memory-failure: remove confusing initialization to count Date: Fri, 24 May 2024 17:13:03 +0800 Message-ID: <20240524091310.1430048-7-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: s91nyn8pbb5u1iwtynthf998ey61qk4u X-Rspamd-Queue-Id: CA12840014 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1716542193-948367 X-HE-Meta: U2FsdGVkX19NgUDSS/N8BK6IGlXiAaSI6eaqIjpe210XCE13vdURC7oaeSlJTzOqhiTFGIlpJP8GFaELmVpCRo6NkY8zpSrT6EdBuIeqvAU3g4FVdUdhKUg3dxeqA4+pOdbFCngrItekYk18DXL8LvpD4m8vNpFHpb1aSyW6Zkq3QYWn0mvuyF1EYFETvzYNzthw97xA+ykrhyR+UJHeY8tU7vOgJaa2DxzWnptD6EHh78ompLZiu9LxbBWYOklP0/f1UyqLvnSxsC5I2MJoQg8pdJ8t4KWJwxz8pXvUd1ZDwzN8+dEiN2D5/R6hx65CuvSDZbZkoFSjFwkX9/s/C7OLBREqbUBYH7yL1d7gW3jzudGwdi7adMlMOkV3ZMF9vHOcvy3c/ExUkwUgmhvyKFWM0i75BnvHm3QJXxOY1ukc/f+N6puzYcUrQnV5aekdxrBP8+Q626yd0y/sYiHcAAkCiFkAIFEjuXuF3M+QycVxdcSWz2I1gZXvhWV20ENlN5uVBqmxRJey7FhquntrZdA30gmpkKHlIDeRILx6Bva2TkpVP4VRI8W8uKrwKPIAJoRwLrRW2UMHhhAUIBYAbMe39fPXMwDCB2W0TJC0h+QQVAfXmDjGDLQjo/hyWD2vRPWHuCo2r9lq9MjClUZ1C3PSUuYL6QAaC6DiQTX+PjGiPJUkDKfP9CDelB3J9h5AMGzISUH2K8SJWVInMWVJOv8ieQOwXT+uiothjgvLmNO+qvDWRSbQL/Lzumeg8RgBDkaPOjX5PMqI24YXfbj24P3TIN+i3BJ444Ew/3RzUODUkFhkfE5tNoP6EvQARl04XOxMWR+emT/taixgkzM+bdLhrRKkbsuOQWidlPN9gBC0IuqGOdgdjeqeR2YDkyB99lZ2Wmjt4H8E2Z2ZgWBoaDwazxo7gYlp92w+FfNAcKUJnOKqwjYxpT0s7/Kl11F/VmMs6jDZ9LdD+3o/pac 4L90CX4Y /oqwsFYjJLp9PTxvBE5/O9ZgYO4Vk1CLyj2TvTJ04PXBeKuah9XhSVPPO0tuuxIsjZeDgChfQ38Ru76IZTZLk6z1M91CnMjeTmVsbsnrqn7n96uj93cqBZMUGzja+7vqpWisI4hNGNHdF0DRUlT2Nh3CTxlPoXTtRyETWry1qy4Aw2CumGfhurKkBmTXCNoBt1lKLOn09hwOUdLU+ndQq3ZZFsA== 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 c09e1bf83682..be9bda281d91 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2573,7 +2573,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 Fri May 24 09:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672903 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 8BC3AC25B74 for ; Fri, 24 May 2024 09:16:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2ED36B00A3; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 988C96B00A4; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8016F6B00A3; Fri, 24 May 2024 05:16:35 -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 5B3C66B00A0 for ; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 12EDEA09A4 for ; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.12.3823F37 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf03.hostedemail.com (Postfix) with ESMTP id E09B020005 for ; Fri, 24 May 2024 09:16:32 +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.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=1716542193; 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=7rOUJAME8DH6FXMXgre8En5Oqq1YGNnjP1BBORlLL80=; b=VLymmDA3mGNfb2GJJ8ZJcm67YvRwVbnIaZKkUr0XsOTuKCGZzAWKcfaKL7jiljNhJobVUB oGt5eGk8+KYgzf5/uI416ikDUNnzGok7Dyd3V82roNGMHkw0Cx8+L1ssQiYnp6Brl9tH4A vwBxdUe3LHSj0+OkYMgOsuCohqLqjQ8= 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.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542193; a=rsa-sha256; cv=none; b=5L2qEYOXwT8uD0tUgeeepMT2ia/yBdPRaIQgK4FbV3VesQOqEUHTEMu2TYZoXydvVcTyK8 sYb5Hv/xSG+smf5IB/YX0Oio6u4vdjTQNXX1T3Y/1VDXIXXjuwcMAFd7vB3F6ec8to/UFx 3qAyq0QAYF7mDZ+iaPHlalnyEgPOrnc= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpS5W1SzwPHB; Fri, 24 May 2024 17:12:48 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 8B0631400D1; Fri, 24 May 2024 17:16: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; Fri, 24 May 2024 17:16:29 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 07/13] mm/memory-failure: remove unneeded hwpoison_filter() variant Date: Fri, 24 May 2024 17:13:04 +0800 Message-ID: <20240524091310.1430048-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: rspam05 X-Rspamd-Queue-Id: E09B020005 X-Stat-Signature: chbbrhk874t63gm4qbh6qgi7m5ysdwyy X-Rspam-User: X-HE-Tag: 1716542192-623692 X-HE-Meta: U2FsdGVkX1+OOcU9VU6aRsKCia7HUOa+Cfhn33ENwBZCgWGwcPEEs7fklsURU7lDiJD1wi9CM9zpjsZkdD8rlGjCDYRfJ/XIjzhg5NzSz5N/eNeDjh8cObyZolsiGvjLISf6RcVVUgnHDcjtDXDjOZyb7So97YRDEkfs0pyzoHdWyCh3qxgsLp2Copo0OBQthLVX5z42PQuQ1B6qrvIwPhKm2LJdaJVi3bt+Wb3pSbdBWX+dxD4ruwZTH18Qs0gvzfB24Mj2NUb+d/TNWuv5FNggG9s9sEbrdXwBK0pj4IpvK7gRzxKw6hWXcZ0bqu3WgdhZwbP+BjVTIteEXbNKhg039sOlnMwKBFZR2tPgwbQNoHKBof6i8TxhbdojZWNnnvdg18GbWGL5sGEFsruSjLHbPXab4zkbOcim8pn8ofAMnVI0bb9OC0BGSIefAmpJv5a2RSaAPXjOYvauS8fC6e4ESm9wjMNed1e75yV+8jggmz01+/+o+IKM4tqWsBrj1Y3YzNwXsL5ww0y64yxqHzofUt9dU4LcwlGioVdkzTKxihRR9KveBLE/3tv3+cnX2zaQKgbTHVezQypxlwpzwnGL/1OR5wMZLB+4NDbtaY6Bi8e8X9Ub5Ol+xD4+H0/KWjfm5voBebDlB4vg6Zdw2gb/qqjEZyB8dhF/ToMQdPhuVu7d2INLCwwFUjL6ENfQbm+tIUxxwte6xkSx0d13wEzrBHGD/7UpUXgYdo2gLZuCBz7/sAj2Awneb4aWuHX8Z+yDVRJZhDk+6xaCcoGib4Ija+tjcl0nfrInM4MwhUiLgF53uKXuN7GwZwuJCAuBW8iVZdLND+6/oZMgWimSgx7r6W82A0KcpTtPGHEEovf7cF5YVsqp7XbaG3yZpePMaMLKD5zC9P64pADDemsi7cEkx3hWgF3LRWRxgMYw1tD6opM7MRdrTvGBOIV3h+bnAeciRWomF9dFWNNoXH/ TUWgDXY3 T0eZAbGrTfCNiig0MRuueyN1j5/+hY66QLWMnIW3sBdVzlS9imTv4mGd2P+2mOY+BtZ0/yrICL9GLBG6ho8CMpbb2LQDQCO+i3ORsmviwp6R72WUV24jysJXJhYqCcqC8v6kA9CWsgdEHBUpMJLwZyTV0bQmGj3J4eZzGrL+54E1D1DNf/BAYNa4OJCVLRbbSkBSS5K/zX2KQ86Dwx3Ib8IQGwllrd8++PqZouRnVcfbV7c1VJsPyF6NwDPNA0OZQC0DfNabmlapeOco= 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: When CONFIG_HWPOISON_INJECT is not enabled, there is no user of the hwpoison_filter(). Remove it. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index be9bda281d91..2c3ecbfc2134 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -294,14 +294,8 @@ int hwpoison_filter(struct page *p) return 0; } -#else -int hwpoison_filter(struct page *p) -{ - return 0; -} -#endif - EXPORT_SYMBOL_GPL(hwpoison_filter); +#endif /* * Kill all processes that have a poisoned page mapped and then isolate From patchwork Fri May 24 09:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672902 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 75869C25B79 for ; Fri, 24 May 2024 09:16:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 433EE6B009C; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 395076B009F; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20F436B00A0; Fri, 24 May 2024 05:16:35 -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 E91BB6B009C for ; Fri, 24 May 2024 05:16:34 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF2871C0694 for ; Fri, 24 May 2024 09:16:34 +0000 (UTC) X-FDA: 82152733908.21.A345863 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id 77F2A20003 for ; Fri, 24 May 2024 09:16:32 +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=1716542192; 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=qoJNvu1RiPUUyDrjtzeI3sYnz0Qolq71EyFL8A9HqE4=; b=WdGHNb7Z1XUAtd6yBgBz9E+ct/rNeVR3+s046rEMfouPMOM+o4O9mmscIZ27Rn5HTKPmlV tQIIZtNceH5kKFq3WSvLX1VCUJpxq9tDWRLEVIuxbRp/v1mqOto9yPLxc+Z/KdwKGVp06u LSeVvtiF40WjG8ScduozjXA163bSotc= 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=1716542192; a=rsa-sha256; cv=none; b=BT/9yYcegU6IZccuUnczFeAKLd9JX5GliuezsVrc8CHCuV5U27SmLUFKqWlYseRGbQOouE 3vBd3LjMSCQqQOQksIPNGM9vZlUb0WVaL6hg2eonaCSUxyM7yxIhlD5rPL4TCa5EVovIo3 rWVQFF+L8WcC8ZUIZ8bTdIZH1yRtXxA= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpQ3LHqzsR5g; Fri, 24 May 2024 17:12:46 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 0AB32180A9C; Fri, 24 May 2024 17:16:30 +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; Fri, 24 May 2024 17:16:29 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Fri, 24 May 2024 17:13:05 +0800 Message-ID: <20240524091310.1430048-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 77F2A20003 X-Stat-Signature: ojffpewigdciqmuung4ox1ir5pz7w9i5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1716542192-383189 X-HE-Meta: U2FsdGVkX1+Sp2P70Iw44gkJjYMgevQC4yf8mDYGr20URWDMjIM7KJZUtBYuKHIDfhClKzRRRYnEflPrEQPMdJc37hRqtoFsCFgjdgPFfr1N80dE17m7Qma/vTep6Pfuvlkxv+gLcWvUN0nPA1o1PBxnWFpUMIVJACOSwwTU12+HGxXZPvuyT3j3s/Pj2f0rM2HzORWw+Hdh71Vg/5CPqD0kAuhw15bOtKFEGmCoQ36dR0TpekzNSPLZ+g5cALMBMgxZqrMGjFU9xZxD7+gvoTXlcNjAB+hfbuh3XMlKxOs+6ITofsoMQx7H6XeeK7DM3Ii79McJXa3iBz52FTe48HsDYIucoyO4JHgiPs9D8VZyN+yuQWa2hERdbncV1/h6bYS7jmDjBUqL+hcRj6fgK4D/1Yzq0MpIQeMhQMjyWaAsl+SQbB8QxMSBlkP5jYvQj/RdV6hdfehWlCtkiSA48RhOPaNJ/BzDwYFa19y2xvfTW8jIkAmdoq4v0Z2z2JeHjukbR5+OxfIma9R1GahkqI700ZyJe+ffkucRFVwBOxT2pNbNxPaOj7nqf3AQ08LWzaC1o552j6k5k5u3huE2zlr0+i1FSvMGLZwvLD41FXqnpzpY25T0f3IJ6spUggiiI7JmwCX4C0N3yOYoMr2QQPt0YlklzLcLZ4bLHuVrY2zD9HdgW3VmhPgYP22JAtOymo0+2TPmH3TTjO2qxj8lhv3r5vehfDmdVAYvakf5MFvdG9xm+bX/WT6kYRqx4Q5tx9w2bzLezExHhKewUKPgY6klVCbEU/p9XuHVBhtA1dJdqRrgrhXSLJtLaeY0Q8xUowgM6qJLUDrddnpFKb6u4Fij2q/ndTESVGPatsgWEKm2fb/NgecbSebmDBqNFxIBjRihLheshd7iIHWneOlJAO11WGa+krduV78Dsm47xfuNQnYLwg0XpSDMURivZkNLPeYJIsWk73FrSl2PWUz 3iK/9wT/ FZwLPi5g4bEH/mRtxM91LsNonS1vOAPGbK0KADCYQXcy6tUAvCNmy8VexguAL3FpmsgQWO0jgvNg+YM5NjBnAAf3+EpJFXqUzX/pSFbssdumnru8b8hcwVSFUZsA4b0AQShNYsBgKemgVZP1T3iuK5MpbdfFmlD463Is49IH/MayYMXIrQmiMNnJkDF4NQH0opoG0FaA50YYtQzhDtmocK8FceGQzIXKdw78k00m0O8tN2aDgH5Pgna15D4UcwJp+BcZVLG7/IgYQtXVdmApyjTIIt8FLc/Z672PN2pfsrhwt/Jk= 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 2c3ecbfc2134..19d338e83e43 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -338,7 +338,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, @@ -356,7 +356,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; } @@ -518,7 +518,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); } @@ -531,7 +531,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 Fri May 24 09:13:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672906 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 1CD20C25B7D for ; Fri, 24 May 2024 09:16:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E1F6B009F; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 607736B00A1; Fri, 24 May 2024 05:16:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2670D6B00A5; Fri, 24 May 2024 05:16:36 -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 D52396B00A4 for ; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8C1EEA1E5A for ; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.22.5C834D7 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf11.hostedemail.com (Postfix) with ESMTP id 56B4D40004 for ; Fri, 24 May 2024 09:16:32 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.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=1716542193; 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=yv/+MUqQc1ZxdzrTulGlIxWx5smDndiSiVS7kKe8Avs=; b=OtING2NfGRPgzIcX7CHAUSUUmyCHM4/ZTfxrxU2nTfRvtsqV/E6lT9MqOM5z4f5MpEa5t8 m+WwME4BUSLxtADe2/L9LZpmvgCU5d6yZL0DdvtMGmclYCJFbQJXiI2TDNgPcJ0Pjj6YQF Ha/u8fJ18cujfZW+8Q9NZ1gJ35KsTNY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542193; a=rsa-sha256; cv=none; b=AYeh7VzcXUHRiOlK7VFYe76rvP5zHj15AmfWr+hHhZtK10HPAoF2+ug7gtBi6qUfQMwaI4 gV5oChBsGkPSX04M0STvzmh4I/uQc8lybtCnVxyJz7wOZlO1KTOgR5VakgRMTn1JF6cqwP Ew7Q6b5h6LzzmLp7EDZ9pue/R+XGBtc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.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.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VlzpT6NSWz1S4rl; Fri, 24 May 2024 17:12:49 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 803351400D1; Fri, 24 May 2024 17:16:30 +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; Fri, 24 May 2024 17:16:29 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 09/13] mm/memory-failure: remove obsolete comment in unpoison_memory() Date: Fri, 24 May 2024 17:13:06 +0800 Message-ID: <20240524091310.1430048-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 56B4D40004 X-Rspam-User: X-Stat-Signature: 49syuhwhfu6ddz3hqesibbrw7ekofch6 X-HE-Tag: 1716542192-39667 X-HE-Meta: U2FsdGVkX1818sDEUrChb89KqLuqY2lMN3APQrMvFtGrgqz/3CkiVwjwviTt36ZDix1EK1QPQFn6T7lEHJG+8IpdR06c2ylStQbxFwixF93MQ3RVLrAN8n1ZIajG0cyj2lLogpuNBMqzByPthTgPyAGW55HDo6kYwg+Ebij06ca3CmYbgS30llbz0UVgetbBZJbRXjjVYP/h8Z+DLLC4RnS9hMakbRs6HPD+KSVKSOcnGI6UrsBphBLp3u5hmU7D2Fed6NmIHTAwEEbwSNd/dKxRadniG6HE+LSzlbwb0HaeTfPUBHJoh0GLTH2jN/xubfxbQF0kiF5Gvd0TkO5D83zMu18zgXQfQXO1kFuFa1upOlbqxDfXusb3kTwwyN7s3VmZGVb2mR5wm6jYgIQU8JsHe7/R19jTkni/OP2tjpdlVlYtF5fdFWedZ07qFHkYIXbpNSs1jqTZu/vn7y/hSMkNEpLzYxf4G7ofFUF8PrHhH6eezZOqbD7H4bQdG8/F6dXoFkEHN3QHg26vemzgYHGmnWCBSMAX8yv4hWsTN6XsuI9zh0nn9/f/zqNUrGmpjVR8vN43spM+xgUWPsEZepOBv/2mjtWv7n7BjhbNnwkX7WuzazxMU0gVr3OF6F2M5E5+jauZXikPRLFUl1BIUqdx8954ztaw+NvQ06d8ozeNVzL7Y0x8w5S8Tcws1vS3zV8bRhmZ3Bzo8UokEqJcIlxlmREHCXhFX2YBXV5gmmJDHmmK2EfzJum7IL9OhNjJl0jyCopDfSxedSL4/L0PLP002wq4E3UrQiUU6m7GMAQUhGcjDNmzrNGoNCpWqSlyFy/cLJoq/JmV8CxFRkG2HcWxJF3XzZMpOkOnurJaNZe1gHGsj85PnElOP8UM0Xw4tGTQleoGZA5xU2crN3eKvZYU1AhuSSNVQs9CO+smImaQcmDR5jEBo0Yup7qTgy4kNBjNYKatBFUDPgTS3ny Kf4TILA/ M4ALKweGPODx8v8EYtKeGllBfS9Ilh2jwJqscfa3m2Ukva+EoS8SPEtRPbOmKAoBkgFESskM95oO1OvVnEwlHur5p1K2+v4yhCnv9sIRaNzc8DxLX3Gr+XC8FAm/DdnaCV5j6FD3SZQ4fVbHgBFZY3OGBYxrTEsPlhgdnvfCqmUn8a5EWF525TAhzoUBdiXSlyPt3aAMf8zYTQr5BkcGj8WKs8k3Yd0v4gVe/AqX7WRt866PYIF/29BLjX60PV9qMjJzV 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 19d338e83e43..e4252f297d41 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2610,10 +2610,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 Fri May 24 09:13:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672909 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 579A7C25B74 for ; Fri, 24 May 2024 09:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A3E16B00A4; Fri, 24 May 2024 05:16:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62EE06B00A6; Fri, 24 May 2024 05:16:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 261476B00A4; Fri, 24 May 2024 05:16:37 -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 D18296B00A8 for ; Fri, 24 May 2024 05:16:36 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 95CA8A098C for ; Fri, 24 May 2024 09:16:36 +0000 (UTC) X-FDA: 82152733992.24.D094410 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf04.hostedemail.com (Postfix) with ESMTP id 257CD40010 for ; Fri, 24 May 2024 09:16:33 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 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=1716542194; 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=AnUx0GHtpqLGFPIKOW2Fk2v1lMR/Tak+U72RaiOw4n0=; b=WVIbKMvLW0Tm5MZ4GkYFOCNeYvPz/ca07fHvE302S03zvA37LhV8T927b1aOjHPBSyOt2B bKl/EX6AaiDu7S0kbvCEEGTaomsjNq8wwrfajdLG4vkj11md1Z3Ie1lLMEYZ+WrPRF9ql/ k4xbWN5kd3ocwyIFB5QCLWbEvxtTJ7s= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542194; a=rsa-sha256; cv=none; b=MdkOon1GrURlnOh6DSX/b9oQsrJBveif23SXlYKqyQ0m0GzTR7H0cmrULwzzazNL4zTPPE bORB0FoheZ2GQZlpqdZ3zCXZ4esOAUACyXdElCAspYRdVho6DiIMuXkEU5erC6XDxTBtDP Y8Sz5dLKji4hmKENPBZu68jy6LactJU= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Vlzph0Cgyz1S5bv; Fri, 24 May 2024 17:13:00 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 10C4F14037C; Fri, 24 May 2024 17:16:31 +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; Fri, 24 May 2024 17:16:30 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 10/13] mm/memory-failure: move some function declarations into internal.h Date: Fri, 24 May 2024 17:13:07 +0800 Message-ID: <20240524091310.1430048-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 257CD40010 X-Stat-Signature: kg8un4k5rz9ucuikh8boqynkbopffnq9 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1716542193-63992 X-HE-Meta: U2FsdGVkX1+ZWXSpm9grl7GpT4Im+ZQ2yLugCsJR/FxPobe9f2cc5iVhQufP+1xvuvbyikZq84aSSpeYP2siDoRQZH4m/Gh980FO2y39KmSwCP/CVPwZPmpoHmrZ6AemcdFQ403LESh97fxB7nsTu9RbggzQlCQcsR2WZ/uuYVsLUkdNcSuw56E4ZM5VvaRbnmnhEeyaXQNl2yGgFWd8hnRBvKUQYhKmC/lXGeZKyHklfdt2kp68XUDP4FZ5Bw3vf5VjiIMWcP9/+WBxGBrH5NjOnsZRgxDc13dvK8WhbQ/GiWaApw2flMFJIJq3CHOlQxnP6fueAB5dIQ1U7xAPtMJmJxjgaVC/hJaRETlKt3LbX50qh073cWKgg+Wz6SsxKCP5GLuBLgUrM2zzI02dKnUTDizfaffzq7BHztVwKbvcV6ebP13PQmsi78MmodwlR0Vo7/dly3o1fFJeq3xDcj84RSaCkCD19DVUcUDJ2YaI5AaskX3IKZqLAKp0DrDIfmzhHOMKbEWctMYVrOvG1ohI2KeNyJCyFkOP+y7amPnhuZGEcNLKrxBKzydagxhv7mQaNliNheCY7rhiU9k12OBlm08m3SQdQJ07rlZSCka1EFgsmSv13DauxlPs0B5BDLPDtqXbrcmimdJXtNe+thCUCveA7hMm2fB4E+urj9r73EEyp5P1NM+zSZE1D6ABA+ge6wyfqnkzmLie7/erqdU5RF5+WoTuzxYkUBaYL79J+YzMe7wTvexDMi6cSFnB+L78lFY1tiuR9bMPij0cL89DSXFPLS1Leindb9vq8C2F0Lyg3iEGm0VMCMvI9y3EGo6thsb9vTwcYNPJkhQ2gA1FToq5jQ+s3XAdizWzfJdofk4w1Ibk9K61LZpsTTERI6YSDJW0XXlNF+MbT9cY8m8zWtnGjO3TLfUb8fhCLkOmDfRddg5Xdr3tL/akkPyek2A/UX/tSnAs2nMDQDX F7eXeo++ tjBe6OfGUfLJI2HS24P7T+FWF71yUSZBFHUgPyqFfrygMAl2gV0tdAVfHzNu95tUiTrZ9pY4/wHlvWS1grfCcMH6ROyO7q9QNMgzDR5OcPSvTZ1D3pnUl12gp+m4hF1kLkEo/FIUeLT1yqX5RyVER6Kz32LUGu0F2ZZ+MwF8IN9O2Xt1AXWRriFKe7MbUYc6gf2oLwyUzYKvdowWZm9FzCZRwSQ== 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. Signed-off-by: Miaohe Lin --- include/linux/mm.h | 13 ------------- include/linux/page-flags.h | 5 ----- include/linux/rmap.h | 2 -- mm/internal.h | 16 ++++++++++++++++ 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 4bc97ae25ade..d5174b3b792b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1330,12 +1330,6 @@ static inline unsigned long page_size(struct page *page) return PAGE_SIZE << compound_order(page); } -/* Returns the number of bits needed for the number of bytes in a page */ -static inline unsigned int page_shift(struct page *page) -{ - return PAGE_SHIFT + compound_order(page); -} - /** * thp_order - Order of a transparent huge page. * @page: Head page of a transparent huge page. @@ -4032,7 +4026,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) { @@ -4053,12 +4046,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 104078afe0b1..00c33a6ea367 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 5cb0d419a1d7..ece0515ee21c 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -733,8 +733,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 bbec99cc9d9d..188e292d2a77 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1061,6 +1061,22 @@ 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); + +/* Returns the number of bits needed for the number of bytes in a page */ +static inline unsigned int page_shift(struct page *page) +{ + return PAGE_SHIFT + compound_order(page); +} extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long, From patchwork Fri May 24 09:13:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672910 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 3FADBC25B79 for ; Fri, 24 May 2024 09:16:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6C276B00A5; Fri, 24 May 2024 05:16:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF6276B00A6; Fri, 24 May 2024 05:16:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B84F16B00A8; Fri, 24 May 2024 05:16:37 -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 942496B00A5 for ; Fri, 24 May 2024 05:16:37 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5450F409AC for ; Fri, 24 May 2024 09:16:37 +0000 (UTC) X-FDA: 82152734034.13.03332D0 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf02.hostedemail.com (Postfix) with ESMTP id 16AA880005 for ; Fri, 24 May 2024 09:16:34 +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=1716542195; 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=phgOIkXa6rBcil5c+zSZCbDGf5oa5pjamPGuSRPUw6g=; b=GPF2laaOEzENcQgpVfPU40/wcWGmBLNX451plK2J2qLS/aHn3+e0/aszVjGj5rB6bvfv78 vKZyKi5hia3EfVduwYjuvas0FqVBi63KsyXf2XeRxVVekFUaSMGdhUycGbZREvRXbI31nO 3FpqE9M+sgw4iQRIQN+5I26bwV3XqiE= 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=1716542195; a=rsa-sha256; cv=none; b=iCkcVZIXb1q8IorIqlQ6xOAplJ1DowtQefS4/DWQ//jyDApn6lqChLhDmKPXKPMjXnBRrn bNmwxo7TAAdEsUs1ITJO/zl2VKON7uUcRDVMghC6vZKuAZJKWAV4ymPHg5eVJzpaNixZLw /zx81nJO5grctSN1aCuRGm1wscgGbIo= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VlzqC226JzPmWX; Fri, 24 May 2024 17:13:27 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 7A7CC1400D1; Fri, 24 May 2024 17:16:31 +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; Fri, 24 May 2024 17:16:30 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 11/13] mm/memory-failure: fix comment of get_hwpoison_page() Date: Fri, 24 May 2024 17:13:08 +0800 Message-ID: <20240524091310.1430048-12-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: j1c5qre47zgmwfxwnfuzg5ujjincj7p1 X-Rspamd-Queue-Id: 16AA880005 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1716542194-340768 X-HE-Meta: U2FsdGVkX1/ybAN+8qcFrQsB2F/GIggjubrTeiZQocMe74EFeYlOSILx2o8Vcd3QM7WA/SowzcctxM0AqMreKEG9nlmgimoyL6LG+6LPaBSHeAR7n9XKFzCOTCWWSXOJRPj/+mtj6mckPS2G8wrTRY0ky9W4fcZEfPAD41mOztcXsxz72BJohYccB/80mXjFgr2bW4SJNPAnOa1V+AT928xRzpnBeqiUaSxxIok3VyOCkwtJLThsRI1BWr2+NX+HGV3YHISx8GgJSBkZmstTedRLqM0rVr3BBMH6bTW97ArrQWS7httGcVdD/m63ObX6H05JVzmxFzYX7J3SQGxgq9D8lS+3qkhrz5tIKnDgwVTFVpNtVvTpdo+458PUOeiVXiWOVZKMao01L94UFTvoAlx39TutGtCUn/eo+71K/RBV9XNHzySH6muPxODd4cOTLNhYRbvi/GqFByQewiFOOa8MNzsxY5OVxJjK6n2F8zIpOah7ydRpT76b6Hg9y2LSuLQaohIjOEaTP4/LzzgTS6lDNJ6R1OL4yR1pCCJbCFIzjKev8aTcJYYvewGIcgP2eGbjO3tUMd0RGKKw0OWb2L79xoQZl07RDJnT3U7qkl3uTzztjRznh/ym5YRH7eMI+xjxmUCbZidujjx0mpj53ylyCSsPIOtHxdnFlaIX4Koe9y153tsFuPhQzJjftHKwxQX68NBvvxXpKuYlYlsZ4++5RNHfd0Wp6KStUvNQTrOCYG5sQLqsSO29mx4jkfsts8pLaFZPLTFDx0loCX6YHXjx5dRRal6ZIfdlql2gNhBv2oY017TY/AiWxAwvttQbU1pyhdZesIoUQSbB5brrHMPlBEArs7Wy+53n4Oj0KhCD4HZ5rHEjV50enuFU3Z9qppC97Tl/pkvJupjWcEsuYdYk/q32Pia3gSytK11Iz3zFmeh3G58YKIf0cRd20iSNPEKPjC9qOz7wnRWheyw ltuv6S3U sp1+X0jZuoJCd4pZ+z/3EQVIAuf9VjqA3QznIEi+M66vrrD5JJq7OqMP/ffi07EC7qZMeRfecnXCtiiREG9KHIr0k1ybk4k+Q6GtHaHVi8o2WnbhxAu/hmLdmzSaaoXXhybGBQ9Lzi2rsdyxfHhDrHM8l/NozzYjVy78FfRqny6BFqOxaKCs4rgaCdzCKjQX3MyFa22Bf8jRj7cERpRqMpsvyO7stLIo1BH5D7j0L6l9oLZlI0KGbRgXc7dNMGBuWk9Cv104js7XRTqk= 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 e4252f297d41..705cd0bbb603 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1549,7 +1549,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 Fri May 24 09:13:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672911 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 A43BAC25B74 for ; Fri, 24 May 2024 09:17:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CCAA6B00A6; Fri, 24 May 2024 05:16:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62E226B00A8; Fri, 24 May 2024 05:16:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 435576B00A9; Fri, 24 May 2024 05:16:38 -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 E937F6B00A8 for ; Fri, 24 May 2024 05:16:37 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 72D50120A23 for ; Fri, 24 May 2024 09:16:37 +0000 (UTC) X-FDA: 82152734034.02.5185420 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf30.hostedemail.com (Postfix) with ESMTP id 18A828000E for ; Fri, 24 May 2024 09:16:34 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 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=1716542195; 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=F+da3HJZTj8WogVcSs+ISuxH9YFAHGJQfBVrIoXzN3Y=; b=6X33/EHuDg5TIE9TbY5b+2Pwug0IVZjeWCri41DcqP2pxBmzxo4apvBKctFs5Kki2cCevJ 5d8hW+siUszCosX0Hdwchy+Q050tK9XJ9zDmyfYqD8RsjsV6s2mMdJRFyApwe3IwWARo25 NAN7YAecx413KFBSF1LYMc8vxdT1U/E= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542195; a=rsa-sha256; cv=none; b=KPBxNEP524ntgBfiH+df1tH46m21kYwX2OmeFlfoA1vZAN+FHUTt15o4LLhF87IW+1cPKk c31OoroULuDKfkpL/G7qxvuZO86c61j1Z3EQhFdueeMnt0WEU6UUuvvpvKG1D9oyYLyOW3 dG/3NgdjlTx7L1QPagxg2l5AlyG+xXI= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Vlzpj3Z9Dz2cMp7; Fri, 24 May 2024 17:13:01 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 0423A14037C; Fri, 24 May 2024 17:16:32 +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; Fri, 24 May 2024 17:16:31 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 12/13] mm/memory-failure: remove obsolete comment in kill_proc() Date: Fri, 24 May 2024 17:13:09 +0800 Message-ID: <20240524091310.1430048-13-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 18A828000E X-Stat-Signature: fy3fu5zqiuhdt8576mnjy5sc1j8ewi3t X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1716542194-393962 X-HE-Meta: U2FsdGVkX1/eNDBHON0ovU2XqOYQBpsja+gfEPURQpg/yJ5+l6MeBADtno2cjk0d/dATrbOSS1jHk9SwSR3HBnTrQZMDBwYfvHPhS3qLNci5BfdZ/rP4huLs9+nP+t+wroJsUdEx5NQLFy3rF0eT/FS7JtLZglb2VUro7moTAfqQY5wAgAGPmQD2J/fo5BwvzNJPlFPCnlF+LgU5/jBj4FtpkTDkXyiUFgSrWg9dNOImEgSFsgdeQdDQmoSvuFx+bRGT1b+4NRyDkpbijgg1C3UItI/GwVzi7ageO9s9KNjnYwR+Or8IN2O2Tt1sYNKI9U6YAj5G0dHSXgfU1RAGSHuu963dvCH9LrSsKSEk+OvtV0oNL2Jh2cJCnlgearqyUzHZu9Y8M/3YUpfKCHS6Pya1M9NY/eTZg2WwwJGEffI3MCoGkE8lmm8ue1+O5PveA0Fm29qdaUmoELsd+DyygCJTlLfQJNoYpUcW3q/vhf1v04op0cRDYW2hflQJRkPnF3z0FdXTT3lnM4yUnAIRl2ogcBvZ/gBmQiphZMDJ6dcPFpfMbWIfLm7rbmTtAMzNmWhx1ltcZnXYhouHljthbwEU3OkRkHYYb/vYVyztFJ+Qk2ts33Oxrdja3zlMOJUPqYJ5/gfEIvLrrXA5A6eVkXmz2KfXu3bGcqLn/w/Aqz8MFGWXXP1QyBNKd6Gk000Jw+8eFP6ZqbWPc7dqWJUIdrQR4XyXsmUDQRAEbLEkeZDb1LL2xbGzZjQPpk0LlRY4r62EPipkg3I6ymX7uF1277q6PpTi4aiApWckrEdbUO9NefLXvvAR2giyVZZe3gfBraNVR3e98YWBuvMZ23sWrkTRWg43QDgSNvbekUBkAm6Yo9z5XBUnrokVnR0In6vQoUPc6R7lZ1ivLiCsez/eHGUQfWMHMJBtJiMBPbI+jKTlDKQkYdth9u43Iy7kWu9Ihj4t+P1jdXiccNBn2j6 iP9Zfcs5 DXlq3zZpU71aqURXj0H0tL+eMHqD1Nyf7IG83cSuj/FsZGdYiXbP23yREMR1j9QK447MAdbcYNqGg6BVhWx+YAfmMEPSB0vzee01FZhb4+oa2VP5jprDtvYRSkPe4muCWaMRSSnEUq3eG6TTZVJC86x0iWjk/iAH5E5vmg3Bh+OJdQRX21zmwuXnIZKUXVXU9bvoS0mZOuHR1eSn6ZOLBvSbmqkeA4H2uClFf1goR7rj6SUpDnMXncok/WWiDEkSjbRgwNKMgb2ddc81nAczEs7OlQfsMCxh5pTBlIXXZlslfiSpduE7hNwHdwg== 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 705cd0bbb603..b6bdb4e2834a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -349,8 +349,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 Fri May 24 09:13:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672912 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 2CD8FC25B7E for ; Fri, 24 May 2024 09:17:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D84CC6B00A8; Fri, 24 May 2024 05:16:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C47AE6B00A9; Fri, 24 May 2024 05:16:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B2196B00AB; Fri, 24 May 2024 05:16:38 -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 7013C6B00A9 for ; Fri, 24 May 2024 05:16:38 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 36E301409A9 for ; Fri, 24 May 2024 09:16:38 +0000 (UTC) X-FDA: 82152734076.29.D5A0B95 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf21.hostedemail.com (Postfix) with ESMTP id 188D11C000C for ; Fri, 24 May 2024 09:16:34 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.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=1716542195; 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=t8CPBt/ewQ8b+z6Pi43gj7ESVcDfsrCNoh/2eI3W3ws=; b=riEoLxYduwuqfWZDRDj6pPgPDjQkbSACtP2FXNK4fNv8tF/DMYIVNZBXBz5R7vfwgM275O JZ7GneA0EO5n17UitDtrYzqMv3ms9DT5COYUQQJEVwiSAv3KEONU+4ngG/MUBA6h++m3r8 /ZJsg2gDYMNNK3+1aARH6Vj0Wmcu/zs= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.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=1716542195; a=rsa-sha256; cv=none; b=uJiYVp+9WxEGymPOFRwYRplHcZ9Qdc4H9Wsl7RGFQw24jqe50+VrtYKUnN4hUC/dbcMW7n hhaCPPoyULbbnPSsOBXnnkJNilMOacDljwjIDKWyWF5vfBujGl6SArx7SpocuaZFMUqmSt Y6MWdRO4u+0p+Y4rDhgVF2g/w2Dg6Qw= Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Vlzpk0WFPz2cMp9; Fri, 24 May 2024 17:13:02 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 8F42714037C; Fri, 24 May 2024 17:16:32 +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; Fri, 24 May 2024 17:16:31 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 13/13] mm/memory-failure: correct comment in me_swapcache_dirty Date: Fri, 24 May 2024 17:13:10 +0800 Message-ID: <20240524091310.1430048-14-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-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: 188D11C000C X-Stat-Signature: fq1e5q1yper7s968f6aswmzt85yojeqo X-HE-Tag: 1716542194-942711 X-HE-Meta: U2FsdGVkX19ZYwqWySCeyOKE2g3W9G7fxB8I32Esxw0LdObg4i9kHkNd8+C0fToLYHtuXjcfFW4dCZm+VqP2dFJGwQmPdkG/PGBJ4m98wlEFjC4rjdj5+Udyc0ngi+IsYE9F+gjY3nQwspWq+0QPJy68CkBaB3vPNt/keDC8e7TY5T2Y9C28xUZU+rxrgML/tN1sddg/yFfacKjmhZi39Z+ZQOcmfZyhRMHHx9wVutVzOvzboQ6tM0m11u1E5zvgBhk1fTPN7wB7eqfO54s8989JSjqmymQcU7fjPlD1FVgAedivUjHp/QeXqndERPjBfxPFTThvBW7BxWzpqpJtBIvDbO/Kvt1Z6bJUCUDsol1bFMldGAlezDxo9UKWVhxcKp3pOxqz3pD+xoUDS70RCVkQ/zrDNmXZs48ftkkkmUO4Fpb69FjCaLiEG73/BZqXB6rwLfnfcT+TgH3xAoPplLALuRbkt0m7wM12KvSVudtutXFkOpCLHq3KuWGqlBITqmUwAvRMHgBN1U/WKnmp29IidEyTGkEnSJoLUhej3FNUQ9OAQlodbfboG52veAkUnBiA1UDJPxzqh/JOivznybrdML+xiDBsBvwprPelhngMTReczbhWQgIeFwPxVmVMiS4tyve+AsogL3Nm6qJ573zwdouDsTBkefWupRpcM9maldWCTqT7WOQstWgXHXk8ime1VdL+kxgfZOxJUBL+4uEhOzKaXc2ouG0DKVPrIyAjTey66C6NTnUGAElkwdYe5wCMbq6de6I19zvixqA5MkvgXls8ovHmKd6jh6LVGrNacwJs3J0bOmgbClOQI5sB0Nh6oLWl03STTXTFSplujKFe7yZuSrOWqPXj0UPCXrjKfrlAHYp9NqtdjDKLD6epZrOJWIr9dcgtb4lnHbDdyTyBK9KM6HPSBt+2iR9MTQkcQsqOmxDP9s1i6RyFoWPDSedzLhTlmrro2x+Zhdg mVExnRJL 95ThmfN1PZyZiAxRwtLg9wVmUztl//NmrX//pbqrqce586JXV6vgzUKyX9HENWDmeWQDpeeL6FrCwu6bvJs3KLfZCIfu2WJnHu/SHAbbCL618Ss90mATrLFADfl3i+lEWjboEIhm8AfxTZbNb8GvhCctxoYygKWZFjExiT9REUGMVbP4nwdob74QXrDWQlvz0HCWIbMPFCQFhLcs81T05F4/Rwo5p7BsU1Z0RX9OBp1lJycfg5UzOO53qCHAEi/m5112t 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 b6bdb4e2834a..16bf67ffa56a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1150,7 +1150,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,