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: 91072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2093262vqo; Mon, 8 May 2023 04:54:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xLnTivo9eQfayXnPyW3b6fQxYXCNUe6P2ZHHHxqdI9g+N5BRN/Z+yprpN6DgCfIRzJPF4 X-Received: by 2002:a17:902:e5c3:b0:1aa:d6ad:4eaa with SMTP id u3-20020a170902e5c300b001aad6ad4eaamr12374131plf.2.1683546882458; Mon, 08 May 2023 04:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683546882; cv=none; d=google.com; s=arc-20160816; b=HxlaALzPoChXbzRW9+lHT9NPtGO6WyhsAjCP/LKHRfNRwQbnQfGv8rI6xusSsQwqkE kM3M3QhnJ+jfztLNNQuTjneKdUulQ7JS7OMEnuTZoDsv9AOL4qP68xITndlhQmeSnzyH 6/4qRy8Bm3i97+aDkM0jTDNL5hz4C8yy2R11g0epMS+uaXz3+Uc+ARsPR69tUCI4fjc8 GtKLFgHElBhvibVzatX0OBmucHZpRgBGk3i8Wq7MBDx3FosgtkyJopJO1rKBQvAEF6tD jXIgPTVEr/t8hOO+MPQVWx1fDoIK/BP3oWjnrt45WiS+EH+gbnNe149KZm7DZmDC5PfZ pLOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QNDCvuYbSG3ZRfk/K0TZBYN6nOfxr4IQ0kfLJ+C2Ryk=; b=QD30JhFB1OQMyK4Jm7bR2Ifo4NODjZW61xElHXumGRY3ZCvxtkoG9ebMyJbtmLTCxt jTt0+jTM4kytnTeTNT/YAb1M4PxVNcwOpYtSgTCuXtqJlRVf325ZInZddyGZ+IVQHsIj jYKo4UKyGUR/ubzfUWBUzVZAcNFTzNioXKBi2FU3j5rH16m95SlTs6zdeXvjFk6SO08r Vn4NeczZg2xVN1JPoUAlTl3u6XR/qDF/MmVBMb2pXLDFB6xXyhPwXsiYHH4eoZnndbiM ZKoN6uGy2hczH7oxKcYEmmo4ZFuit321FSEvhZr0tvu11Cl/3vPIujQQHn5p8zbqZ3EB 8PAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a170902d49000b0019a826d3054si8233224plg.640.2023.05.08.04.54.29; Mon, 08 May 2023 04:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235711AbjEHLYi (ORCPT + 99 others); Mon, 8 May 2023 07:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235653AbjEHLYS (ORCPT ); Mon, 8 May 2023 07:24:18 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CE1E37031 for ; Mon, 8 May 2023 04:24:18 -0700 (PDT) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765326855509677466?= X-GMAIL-MSGID: =?utf-8?q?1765326855509677466?= 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,