aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
authorAndrew Morton <akpm@linux-foundation.org>2026-05-28 14:35:22 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-05-28 21:31:08 -0700
commit3efa15243a5f7aa5d002642efc819f6219d1c66e (patch)
treef46b08540fcefb2bbe9b6e56e59b4489d31bc01e /mm
parent9b1395104a065c20f777b06c497a527a078b9044 (diff)
downloadlinux-next-history-3efa15243a5f7aa5d002642efc819f6219d1c66e.tar.gz
memcgv1: don't compile swap functions when CONFIG_SWAP=n
Stub these out to save some dead code and to fix a build error with the upcoming "mm/memcg, swap: store cgroup id in cluster table directly". Link: https://lore.kernel.org/202605281711.bSeZlErK-lkp@intel.com Cc: David Hildenbrand <david@kernel.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kairui Song <kasong@tencent.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol-v1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
index 494e7b9adc60a..517b21236672b 100644
--- a/mm/memcontrol-v1.c
+++ b/mm/memcontrol-v1.c
@@ -604,6 +604,7 @@ void memcg1_commit_charge(struct folio *folio, struct mem_cgroup *memcg)
local_irq_restore(flags);
}
+#ifdef CONFIG_SWAP
/**
* __memcg1_swapout - transfer a memsw charge to swap
* @folio: folio whose memsw charge to transfer
@@ -723,6 +724,7 @@ void memcg1_swapin(struct folio *folio)
swap_cluster_unlock(ci);
mem_cgroup_uncharge_swap(id, nr_pages);
}
+#endif
void memcg1_uncharge_batch(struct mem_cgroup *memcg, unsigned long pgpgout,
unsigned long nr_memory, int nid)