]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: memcg: lookup_page_cgroup (almost) never returns NULL
authorJohannes Weiner <jweiner@redhat.com>
Thu, 8 Dec 2011 04:42:46 +0000 (15:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Dec 2011 04:19:17 +0000 (15:19 +1100)
commit58ea327f096a113817ce4b389dbca58bfd4caa9b
tree17fedd7cfdfd6365cd8e67b6247fc975ba2f9816
parent42197bc484cba585e67e083cb01d92edc736395d
mm: memcg: lookup_page_cgroup (almost) never returns NULL

Pages have their corresponding page_cgroup descriptors set up before they
are used in userspace, and thus managed by a memory cgroup.

The only time where lookup_page_cgroup() can return NULL is in the
CONFIG_DEBUG_VM-only page sanity checking code that executes while feeding
pages into the page allocator for the first time.

Remove the NULL checks against lookup_page_cgroup() results from all
callsites where we know that corresponding page_cgroup descriptors must be
allocated, and add a comment to the callsite that actually does have to
check the return value.

Signed-off-by: Johannes Weiner <jweiner@redhat.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c