diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2011-03-23 19:42:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 22:46:25 -0400 |
commit | af4a662144884a7dbb19acbef70878b3b955f928 (patch) | |
tree | f16b04ed13de1ad1938af551e406879b90d4b0ca /mm | |
parent | c14f35c70e068392ccae0b2d6f755baea5eed4d6 (diff) |
memcg: remove NULL check from lookup_page_cgroup() result
The page_cgroup array is set up before even fork is initialized. I
seriously doubt that this code executes before the array is alloc'd.
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')
-rw-r--r-- | mm/memcontrol.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b94cd24c5baa..3a2d54bdf076 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -2369,10 +2369,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, | |||
2369 | } | 2369 | } |
2370 | 2370 | ||
2371 | pc = lookup_page_cgroup(page); | 2371 | pc = lookup_page_cgroup(page); |
2372 | /* can happen at boot */ | 2372 | BUG_ON(!pc); /* XXX: remove this and move pc lookup into commit */ |
2373 | if (unlikely(!pc)) | ||
2374 | return 0; | ||
2375 | prefetchw(pc); | ||
2376 | 2373 | ||
2377 | ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, oom, page_size); | 2374 | ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, oom, page_size); |
2378 | if (ret || !mem) | 2375 | if (ret || !mem) |