Skip to content

Commit

Permalink
memcg: remove impossible conditional when committing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Mar 24, 2011
1 parent 3403968 commit c14f35c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,10 +2118,6 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
{
int nr_pages = page_size >> PAGE_SHIFT;

/* try_charge() can return NULL to *memcg, taking care of it. */
if (!mem)
return;

lock_page_cgroup(pc);
if (unlikely(PageCgroupUsed(pc))) {
unlock_page_cgroup(pc);
Expand Down

0 comments on commit c14f35c

Please sign in to comment.