diff options
| author | Andrew Morton <akpm@linux-foundation.org> | 2026-05-28 14:35:22 -0700 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-05-28 21:31:08 -0700 |
| commit | 3efa15243a5f7aa5d002642efc819f6219d1c66e (patch) | |
| tree | f46b08540fcefb2bbe9b6e56e59b4489d31bc01e /include | |
| parent | 9b1395104a065c20f777b06c497a527a078b9044 (diff) | |
| download | linux-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 'include')
| -rw-r--r-- | include/linux/memcontrol.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index bf1a6e131ecaa..8f2662db166b4 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1900,9 +1900,6 @@ static inline void mem_cgroup_exit_user_fault(void) current->in_user_fault = 0; } -void __memcg1_swapout(struct folio *folio, struct swap_cluster_info *ci); -void memcg1_swapin(struct folio *folio); - #else /* CONFIG_MEMCG_V1 */ static inline unsigned long memcg1_soft_limit_reclaim(pg_data_t *pgdat, int order, @@ -1930,6 +1927,15 @@ static inline void mem_cgroup_exit_user_fault(void) { } +#endif /* CONFIG_MEMCG_V1 */ + +#if defined(CONFIG_MEMCG_V1) && defined(CONFIG_SWAP) + +void __memcg1_swapout(struct folio *folio, struct swap_cluster_info *ci); +void memcg1_swapin(struct folio *folio); + +#else + static inline void __memcg1_swapout(struct folio *folio, struct swap_cluster_info *ci) { @@ -1938,7 +1944,6 @@ static inline void __memcg1_swapout(struct folio *folio, static inline void memcg1_swapin(struct folio *folio) { } - -#endif /* CONFIG_MEMCG_V1 */ +#endif #endif /* _LINUX_MEMCONTROL_H */ |
