From patchwork Fri Sep 9 09:24:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971374 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 7FD0CC6FA82 for ; Fri, 9 Sep 2022 09:25:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75BC294000B; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CEB48D0003; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44772940007; Fri, 9 Sep 2022 05:25:32 -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 28B6C8D000B for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E991DAB344 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) X-FDA: 79892014062.26.D6DF39B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf03.hostedemail.com (Postfix) with ESMTP id 4061A20073 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9Wb5xM9znVBC; Fri, 9 Sep 2022 17:22:51 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:27 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 05/16] mm/page_alloc: add __init annotations to init_mem_debugging_and_hardening() Date: Fri, 9 Sep 2022 17:24:40 +0800 Message-ID: <20220909092451.24883-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715531; a=rsa-sha256; cv=none; b=aFUCzehWoj/efv3VpWtIUFvwk2l3l7WP7nX2PLIiKhPw7lnDg3784SU80CfAHyNgZ7mFu6 GVKa57LsbYP7wRCXkMMNCAjDlNF+eFirEnATfecIpxnK07En9JkaWroUsbPdX7XpV4Mm/H 6u1k8Kr+7j5hrB7wwBbsZmdMIF0SmLY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715531; 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=BsdEgiIXH29TQyM4Lux2WCwNCt4hpS8ehaWLbizfKEY=; b=o2Kkt76LzcK0N/6F88R2SEtkQpgNPmiTb8ewwghoM65mQX6Tqh6lRwp5qAWU1H9mGugtgA oIaqkvr4Z5nXNex007azep41ZP09feWhxNfJ6DZTVfVFpIa78+D1Oe4dLPe7fBYRhcWUV/ +LqHIsBCwtDo6mA8Pi5AqtF3KRdje24= X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: 98p8a7119bqk3gyzzuukj4h8m5qyjuhz X-Rspamd-Queue-Id: 4061A20073 Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662715531-64330 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: It's only called by mm_init(). Add __init annotations to it. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/mm.h | 2 +- mm/page_alloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 364bcadb4d20..c2277f5aba9e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3093,7 +3093,7 @@ extern int apply_to_existing_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); -extern void init_mem_debugging_and_hardening(void); +extern void __init init_mem_debugging_and_hardening(void); #ifdef CONFIG_PAGE_POISONING extern void __kernel_poison_pages(struct page *page, int numpages); extern void __kernel_unpoison_pages(struct page *page, int numpages); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c81f06d8a4f5..3497919f4ef5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -903,7 +903,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page, * order of appearance. So we need to first gather the full picture of what was * enabled, and then make decisions. */ -void init_mem_debugging_and_hardening(void) +void __init init_mem_debugging_and_hardening(void) { bool page_poisoning_requested = false;