Skip to content

Commit

Permalink
memcg: convert threshold to bytes
Browse files Browse the repository at this point in the history
page_counter_memparse() returns pages for the threshold, while
mem_cgroup_usage() returns bytes for memory usage.  Convert the
threshold to bytes.

Fixes: 3e32cb2 ("memcg: rename cgroup_event to mem_cgroup_event").
Signed-off-by: Shaohua Li <shli@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Oct 16, 2015
1 parent 8d740a3 commit 424cdc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3387,6 +3387,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);

Expand Down

0 comments on commit 424cdc1

Please sign in to comment.