linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: mark mem_cgroup_page_stat() underflow unlikely
@ 2010-11-09 20:21 Greg Thelen
  0 siblings, 0 replies; only message in thread
From: Greg Thelen @ 2010-11-09 20:21 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Balbir Singh, KAMEZAWA Hiroyuki, Daisuke Nishimura,
	Johannes Weiner, Wu Fengguang, Minchan Kim, linux-mm,
	linux-kernel, Greg Thelen

Add unlikely() to indicate that underflow of per-cpu counter
sum is not expected.

The underflow is already handled, but should have been
marked unlikely.

Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Greg Thelen <gthelen@google.com>
---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ed070d0..e8fbade 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1393,7 +1393,7 @@ unsigned long mem_cgroup_page_stat(struct mem_cgroup *mem,
 	 * value.  This function returns an unsigned value, so round it up to
 	 * zero to avoid returning a very large value.
 	 */
-	if (value < 0)
+	if (unlikely(value < 0))
 		value = 0;
 
 	put_online_cpus();
-- 
1.7.3.1

--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-09 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 20:21 [PATCH] memcg: mark mem_cgroup_page_stat() underflow unlikely Greg Thelen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox