From patchwork Thu Apr 21 12:47:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Jialin X-Patchwork-Id: 12821584 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 AF155C433F5 for ; Thu, 21 Apr 2022 12:48:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 480106B0073; Thu, 21 Apr 2022 08:48:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 408726B0074; Thu, 21 Apr 2022 08:48:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25B4F6B0075; Thu, 21 Apr 2022 08:48:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 157446B0073 for ; Thu, 21 Apr 2022 08:48:56 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DAF4626899 for ; Thu, 21 Apr 2022 12:48:55 +0000 (UTC) X-FDA: 79380865830.10.77696CB Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf14.hostedemail.com (Postfix) with ESMTP id 2C4EE10001F for ; Thu, 21 Apr 2022 12:48:52 +0000 (UTC) Received: from kwepemi500001.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kkcm656vMzhXyl; Thu, 21 Apr 2022 20:48:38 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by kwepemi500001.china.huawei.com (7.221.188.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 21 Apr 2022 20:48:45 +0800 Received: from ubuntu1804.huawei.com (10.67.174.175) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 21 Apr 2022 20:48:45 +0800 From: Lu Jialin To: Johannes Weiner , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Matthew Wilcox , Yang Shi , Suren Baghdasaryan , "Vlastimil Babka" CC: Lu Jialin , Wang Weiyang , , , Subject: [PATCH -next] mm/memcontrol.c: make cgroup_memory_noswap static Date: Thu, 21 Apr 2022 20:47:36 +0800 Message-ID: <20220421124736.62180-1-lujialin4@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.175] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 2C4EE10001F X-Stat-Signature: 44fwcc49bkqyh7a8fh6yacd3bwak8amr Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf14.hostedemail.com: domain of lujialin4@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=lujialin4@huawei.com X-HE-Tag: 1650545332-379696 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: cgroup_memory_noswap is only used in mm/memcontrol.c, therefore just make it static, and remove export in include/linux/memcontrol.h Signed-off-by: Lu Jialin Acked-by: Johannes Weiner Acked-by: Shakeel Butt Acked-by: Roman Gushchin Reviewed-by: Muchun Song --- include/linux/memcontrol.h | 4 ---- mm/memcontrol.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index a68dce3873fc..2406cc5153d4 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -937,10 +937,6 @@ struct mem_cgroup *mem_cgroup_get_oom_group(struct task_struct *victim, struct mem_cgroup *oom_domain); void mem_cgroup_print_oom_group(struct mem_cgroup *memcg); -#ifdef CONFIG_MEMCG_SWAP -extern bool cgroup_memory_noswap; -#endif - void folio_memcg_lock(struct folio *folio); void folio_memcg_unlock(struct folio *folio); void lock_page_memcg(struct page *page); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 725f76723220..2fc363ee258c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -89,7 +89,7 @@ static bool cgroup_memory_nokmem __ro_after_init; /* Whether the swap controller is active */ #ifdef CONFIG_MEMCG_SWAP -bool cgroup_memory_noswap __ro_after_init; +static bool cgroup_memory_noswap __ro_after_init; #else #define cgroup_memory_noswap 1 #endif