/* Charge the memory controller for page usage. Return 0 if the charge was successful < 0 if the cgroup is over its limit  */
static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, gfp_t gfp_mask, enum charge_type ctype, struct mem_cgroup *memcg)
/* Charge the memory controller for page usage. Return 0 if the charge was successful < 0 if the cgroup is over its limit  */
static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, gfp_t gfp_mask, enum charge_type ctype, struct mem_cgroup *memcg)
{
	struct mem_cgroup *mem;
	struct page_cgroup *pc;
	int ret;
	pc = lookup_page_cgroup(page);
	if (unlikely(!pc))
		return 0;
	prefetchw(pc);
	mem = memcg;
	ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, true, page);
	if (ret || !mem)
		return ret;
	__mem_cgroup_commit_charge(mem, pc, ctype);
	return 0;
}