Skip to contentSkip to conversation

memcg: mark mem_cgroup_page_stat() underflow unlikely

PATCH New Greg Thelen 1 participant 1 message Nov 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memcg: mark mem_cgroup_page_stat() underflow unlikely

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.

---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
index ed070d0..e8fbade 100644
@@ -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();
Signature · 8 lines
1.7.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  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:"[email protected]"> [email protected] </a>