linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: convert threshold to bytes
@ 2015-10-05 21:44 Shaohua Li
  2015-10-05 22:03 ` Andrew Morton
  2015-10-06 17:01 ` Michal Hocko
  0 siblings, 2 replies; 9+ messages in thread
From: Shaohua Li @ 2015-10-05 21:44 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, Johannes Weiner, Michal Hocko

The page_counter_memparse() returns pages for the threshold, while
mem_cgroup_usage() returns bytes for memory usage. Convert the threshold
to bytes.

Looks a regression introduced by 3e32cb2e0a12b69150

Signed-off-by: Shaohua Li <shli@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 1fedbde..d9b5c81 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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);
 
-- 
2.4.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-07 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 21:44 [PATCH] memcg: convert threshold to bytes Shaohua Li
2015-10-05 22:03 ` Andrew Morton
2015-10-06 17:01 ` Michal Hocko
2015-10-06 19:22   ` Andrew Morton
2015-10-07  7:30     ` Michal Hocko
2015-10-07  7:58       ` Andrew Morton
2015-10-07  8:30         ` Michal Hocko
2015-10-07 15:25           ` Shaohua Li
2015-10-07 15:56         ` Greg Thelen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).