mm: kmem: switch to nr_pages in (__)memcg_kmem_charge_memcg()

These functions are charging the given number of kernel pages to the given
memory cgroup.  The number doesn't have to be a power of two.  Let's make
them to take the unsigned int nr_pages as an argument instead of the page
order.

It makes them look consistent with the corresponding uncharge functions
and functions like: mem_cgroup_charge_skmem(memcg, nr_pages).

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Link: http://lkml.kernel.org/r/20200109202659.752357-5-guro@fb.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
这个提交包含在:
Roman Gushchin
2020-04-01 21:06:49 -07:00
提交者 Linus Torvalds
父节点 f4b00eab50
当前提交 92d0510c35
修改 3 个文件,包含 11 行新增10 行删除

查看文件

@@ -365,7 +365,7 @@ static __always_inline int memcg_charge_slab(struct page *page,
return 0;
}
ret = memcg_kmem_charge_memcg(memcg, gfp, order);
ret = memcg_kmem_charge_memcg(memcg, gfp, 1 << order);
if (ret)
goto out;