emm: allow cgroup object API usage from moduels

Upstream: no

Export related core symbols.

Signed-off-by: Kairui Song <kasong@tencent.com>
This commit is contained in:
Kairui Song 2023-09-27 19:36:28 +08:00
parent 494a066aaf
commit e706a93cc6
1 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,7 @@ struct cgroup_subsys memory_cgrp_subsys __read_mostly;
EXPORT_SYMBOL(memory_cgrp_subsys);
struct mem_cgroup *root_mem_cgroup __read_mostly;
EXPORT_SYMBOL_GPL(root_mem_cgroup);
/* Active memory cgroup to use from an interrupt context */
DEFINE_PER_CPU(struct mem_cgroup *, int_active_memcg);
@ -800,6 +801,7 @@ void __mod_memcg_state(struct mem_cgroup *memcg, int idx, int val)
__this_cpu_add(memcg->vmstats_percpu->state[idx], val);
memcg_rstat_updated(memcg, val);
}
EXPORT_SYMBOL_GPL(__mod_memcg_state);
/* idx can be of type enum memcg_stat_item or node_stat_item. */
static unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx)
@ -3430,11 +3432,13 @@ int obj_cgroup_charge(struct obj_cgroup *objcg, gfp_t gfp, size_t size)
return ret;
}
EXPORT_SYMBOL_GPL(obj_cgroup_charge);
void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size)
{
refill_obj_stock(objcg, size, true);
}
EXPORT_SYMBOL_GPL(obj_cgroup_uncharge);
#endif /* CONFIG_MEMCG_KMEM */