From patchwork Mon May 8 11:41:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13234322 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 EF776C77B73 for ; Mon, 8 May 2023 11:24:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D3606B0078; Mon, 8 May 2023 07:24:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0833A6B007D; Mon, 8 May 2023 07:24:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB50F6B007E; Mon, 8 May 2023 07:24:23 -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 D8DB86B0078 for ; Mon, 8 May 2023 07:24:23 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9BE481407D9 for ; Mon, 8 May 2023 11:24:23 +0000 (UTC) X-FDA: 80766854406.27.9FC0B26 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf28.hostedemail.com (Postfix) with ESMTP id B29F7C0007 for ; Mon, 8 May 2023 11:24:20 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@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=1683545061; 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: references; bh=QNDCvuYbSG3ZRfk/K0TZBYN6nOfxr4IQ0kfLJ+C2Ryk=; b=t784eRArXSEoXWH8OsA1At7/xlgzVNF+rd4WToyRw/qLluyF8afbITJdlFi1+yCtd9BiKN GtN95TZG/qAfVFlxxpoJTzYOrMgAbnGZYfK9qTEsRxrT/fE8HwDOiKyi/ddH+u4nUabDBH XTgKwVAaIdtuysegLsiXvrwkGPToZVg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683545061; a=rsa-sha256; cv=none; b=s3BQg7GjdCfX2C0HWj4zrbAJBun3lc+8w5sOktTRZVW6q8Y+oZXDMfT9foTo5/Xg4bBrBg Ron2P4zGldjS37yF7KFmiOTPQTeLc6FhngrXlEtqgWQltAXz15SjPkq7jonKKT97f89c0X XQhoy+4tUqHuuxxUNneP4gB9sffLCvA= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QFJjf2dNpzpV29; Mon, 8 May 2023 19:20:06 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 19:24:14 +0800 From: Kefeng Wang To: Naoya Horiguchi , Andrew Morton CC: , , Kefeng Wang Subject: [PATCH 1/2] mm: memory_failure: move memory_failure_attr_group under MEMORY_FAILURE Date: Mon, 8 May 2023 19:41:27 +0800 Message-ID: <20230508114128.37081-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Stat-Signature: agrt3h5z4cz6inr7rzoaksfu8jtnk5cc X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B29F7C0007 X-Rspam-User: X-HE-Tag: 1683545060-137136 X-HE-Meta: U2FsdGVkX18G1BqYWKvNOiA2BXg+Uh7qp+x7E75g7ujoagB6E6I2QtEcIo5DTikmP/EQ2DyK6H+rqZi48Xd7QF/10ahtxC9VdhDZo/BmGIj+h+ycA8lxGhDM4eX23TtcK59NkkJNLdnKfM4YRB/uj1K5kTrXhulm5jqkNwEq3gZTP33xyXMc84rdJmv75F+QwnfQxADeiE1VoqwHRedQeuAYlmCAP92vRm0y19V+4Thx+Vs+OFAAcGVi3eLFQfRMvK+hYmXrxAEzV9MnqG/aKWft7o952sSCDuyULE1aco11tSh8qlEWneRB7h4uaP1/FKRaLa2Wbghh5UAe/AiGHw8jqoUGeoQpOZlioo7Q3dzWduBhCoVapEnVwoOqK5TXkcTofMWR1G9zKfnRw2OtlU43JFuXUTXw5RiFFXLA9TB8qiz2AqV3nDZ+TXcsqlUEKLyoOjGXjaktxPjp2/DKHBUP9lExb/kxEridSrKosakRvm9ATnIZCQcx6ebKlqo2vgz5JqZpzdB8qJqOWrBLYMcahEYoOyeoTM08Hj91RJraC56fda6aV9X1yS09wStCZu1YbN4oeFDqWfpQF+AyCXqdXFsFP/go7WTuutcm/Fbb199a3i0LTRpwdgI17SokbN8oCjsueAz/16HNpPKEkgokxULtcW4RWnoYSFJ1DGGvtTWUo10kczdBzlmRg9JSf/Ugk7hrGeFkEr68KBV6+QMXTxVdSkBUDW88mZeLzNtBZ1NPmwxKdkfRX5PPf5iSExDYl1o4NB9zuldF3xl68i83pgwUvNea6mj+YoR3HSLjUbNHp9afGhEPbhWJi/jG3SV4EH+0f8CtQMjhmfqaf2AZwtMHJGXyMzVG7a+Dps8dUGGHzq4gOM1/lfzUpOVSf51Ii8hW8owJquxTlv+J4rQmNMvrr1o40BUgt1mLkd23Og5MWylwR3risqQ6Ibpwp1TY0FXyfFrdjE1Wqs8 IqjIrQ9f kQFrtOjI9JtqRRB7CkBfiBCN0ydt6TFVKIsQMM0DManqO7u5fzZDw9wLQbXTX8nWR0/rAGEn7swj5FjS11762i+cpbelsdkK/18c4BIpHM8DYVoXC35EtjsK9ajJbfT4D1179vYJAqRY9WrZ4c3uRyMhYDnQBOYTG+HyFoBUxTPSgPz1RrU0gzQI5zed1r7EgIbEj 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: The memory_failure_attr_group is only called if MEMORY_FAILURE enabled, move it under this configuration. Signed-off-by: Kefeng Wang Acked-by: Naoya Horiguchi --- include/linux/mm.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index d533ef955dd0..cdb0377f97fa 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3687,6 +3687,10 @@ extern void shake_page(struct page *p); extern atomic_long_t num_poisoned_pages __read_mostly; extern int soft_offline_page(unsigned long pfn, int flags); #ifdef CONFIG_MEMORY_FAILURE +/* + * Sysfs entries for memory failure handling statistics. + */ +extern const struct attribute_group memory_failure_attr_group; extern void memory_failure_queue(unsigned long pfn, int flags); extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); @@ -3779,11 +3783,6 @@ enum mf_action_page_type { MF_MSG_UNKNOWN, }; -/* - * Sysfs entries for memory failure handling statistics. - */ -extern const struct attribute_group memory_failure_attr_group; - #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) extern void clear_huge_page(struct page *page, unsigned long addr_hint,