2023-06-15 04:02:25

by Zhongkun He

[permalink] [raw]
Subject: [RFC PATCH 2/3] memcg: export obj_cgroup* symbol to charge compressed RAM

Export obj_cgroup* symbol to charge compressed memory in
zsmalloc module.

Signed-off-by: Zhongkun He <[email protected]>
---
mm/memcontrol.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4b27e245a055..8ba93afacf31 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3064,6 +3064,7 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void)
rcu_read_unlock();
return objcg;
}
+EXPORT_SYMBOL(get_obj_cgroup_from_current);

struct obj_cgroup *get_obj_cgroup_from_page(struct page *page)
{
@@ -3431,11 +3432,13 @@ int obj_cgroup_charge(struct obj_cgroup *objcg, gfp_t gfp, size_t size)

return ret;
}
+EXPORT_SYMBOL(obj_cgroup_charge);

void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size)
{
refill_obj_stock(objcg, size, true);
}
+EXPORT_SYMBOL(obj_cgroup_uncharge);

#endif /* CONFIG_MEMCG_KMEM */

--
2.25.1