We don't use those helpers, and moreover the memsw usage in memcg_uncharge_kmem() is incorrect on cgroup-v2.
This reverts commit 90799889db0664bedf860fcc645f5d7145905c7c. https://virtuozzo.atlassian.net/browse/VSTOR-105819 Signed-off-by: Pavel Tikhomirov <[email protected]> Feature: mm: enhancements --- include/linux/memcontrol.h | 11 ----------- mm/memcontrol.c | 19 ------------------- 2 files changed, 30 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 3a6b90cd36e36..83e050054cfa1 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -978,9 +978,6 @@ static inline bool mem_cgroup_online(struct mem_cgroup *memcg) } bool mem_cgroup_dcache_is_low(struct mem_cgroup *memcg, int vfs_cache_min_ratio); -int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, unsigned long nr_pages); -void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages); - struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm); static inline unsigned long mm_overdraft(struct mm_struct *mm) @@ -1473,14 +1470,6 @@ static inline bool mem_cgroup_dcache_is_low(struct mem_cgroup *memcg, return false; } -static inline int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, - unsigned long nr_pages) -{ - return 0; -} -static inline void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages) -{ } - static inline unsigned long mm_overdraft(struct mm_struct *mm) { return 0; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a61e2a8326c13..326f92657c2d3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3112,25 +3112,6 @@ void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size) refill_obj_stock(objcg, size, true); } -int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, - unsigned long nr_pages) -{ - int ret = 0; - - ret = try_charge(memcg, gfp, nr_pages, false); - if (!ret) - page_counter_charge(&memcg->kmem, nr_pages); - - return ret; -} - -void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages) -{ - page_counter_uncharge(&memcg->kmem, nr_pages); - page_counter_uncharge(&memcg->memory, nr_pages); - page_counter_uncharge(&memcg->memsw, nr_pages); -} - static inline size_t obj_full_size(struct kmem_cache *s) { /* -- 2.51.0 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
