From: Shaohua Li Date: Thu, 15 Oct 2015 22:28:29 +0000 (-0700) Subject: memcg: convert threshold to bytes X-Git-Tag: v4.1.12~28 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2105f9aec785cbc4679132abb44645bb3c59a93e;p=users%2Fjedix%2Flinux-maple.git memcg: convert threshold to bytes commit 424cdc14138088ada1b0e407a2195b2783c6e5ef upstream. page_counter_memparse() returns pages for the threshold, while mem_cgroup_usage() returns bytes for memory usage. Convert the threshold to bytes. Fixes: 3e32cb2e0a12b6915 ("memcg: rename cgroup_event to mem_cgroup_event"). Signed-off-by: Shaohua Li Cc: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a04225d372ba..68dea90334cb 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3677,6 +3677,7 @@ static int __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, ret = page_counter_memparse(args, "-1", &threshold); if (ret) return ret; + threshold <<= PAGE_SHIFT; mutex_lock(&memcg->thresholds_lock);