aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2011-03-23 19:42:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:24 -0400
commitc14f35c70e068392ccae0b2d6f755baea5eed4d6 (patch)
tree1e3265ba63a859ee0b45ae89303afea4de19012c /mm/memcontrol.c
parent3403968d7a7dc373901cad0cad56b3afcb09cc50 (diff)
memcg: remove impossible conditional when committing
No callsite ever passes a NULL pointer for a struct mem_cgroup * to the committing function. There is no need to check for it. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Minchan Kim <minchan.kim@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0595e2b184a2..b94cd24c5baa 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2118,10 +2118,6 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
2118{ 2118{
2119 int nr_pages = page_size >> PAGE_SHIFT; 2119 int nr_pages = page_size >> PAGE_SHIFT;
2120 2120
2121 /* try_charge() can return NULL to *memcg, taking care of it. */
2122 if (!mem)
2123 return;
2124
2125 lock_page_cgroup(pc); 2121 lock_page_cgroup(pc);
2126 if (unlikely(PageCgroupUsed(pc))) { 2122 if (unlikely(PageCgroupUsed(pc))) {
2127 unlock_page_cgroup(pc); 2123 unlock_page_cgroup(pc);