diff mbox series

[-next] mm/memcontrol.c: make cgroup_memory_noswap static

Message ID 20220421124736.62180-1-lujialin4@huawei.com (mailing list archive)
State New
Headers show
Series [-next] mm/memcontrol.c: make cgroup_memory_noswap static | expand

Commit Message

Lu Jialin April 21, 2022, 12:47 p.m. UTC
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 <lujialin4@huawei.com>
---
 include/linux/memcontrol.h | 4 ----
 mm/memcontrol.c            | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

Comments

Johannes Weiner April 21, 2022, 2:22 p.m. UTC | #1
On Thu, Apr 21, 2022 at 08:47:36PM +0800, Lu Jialin wrote:
> 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 <lujialin4@huawei.com>

Nice. Unused since 2d1c498072de ("mm: memcontrol: make swap tracking
an integral part of memory control"), which removed the two instances
from mm/swap_cgroup.c.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Shakeel Butt April 21, 2022, 3:25 p.m. UTC | #2
On Thu, Apr 21, 2022 at 5:48 AM Lu Jialin <lujialin4@huawei.com> wrote:
>
> 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 <lujialin4@huawei.com>

Acked-by: Shakeel Butt <shakeelb@google.com>
Roman Gushchin April 21, 2022, 6:23 p.m. UTC | #3
On Thu, Apr 21, 2022 at 08:47:36PM +0800, Lu Jialin wrote:
> 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 <lujialin4@huawei.com>

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!
Muchun Song April 22, 2022, 2:23 a.m. UTC | #4
On Thu, Apr 21, 2022 at 08:47:36PM +0800, Lu Jialin wrote:
> 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 <lujialin4@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.
diff mbox series

Patch

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