diff options
Diffstat (limited to 'mm/memcontrol-v1.c')
| -rw-r--r-- | mm/memcontrol-v1.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index a3ea4a5e8c96..34579085559f 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -2913,6 +2913,18 @@ struct cftype memsw_files[] = { { }, /* terminate */ }; +#ifdef CONFIG_MEMCG_KMEM +void memcg1_account_kmem(struct mem_cgroup *memcg, int nr_pages) +{ + if (!cgroup_subsys_on_dfl(memory_cgrp_subsys)) { + if (nr_pages > 0) + page_counter_charge(&memcg->kmem, nr_pages); + else + page_counter_uncharge(&memcg->kmem, -nr_pages); + } +} +#endif /* CONFIG_MEMCG_KMEM */ + static int __init memcg1_init(void) { int node; |