Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c14f35c7 authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds
Browse files

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: default avatarJohannes Weiner <hannes@cmpxchg.org>
Acked-by: default avatarKAMEZAWA 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3403968d
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -2118,10 +2118,6 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
{
{
	int nr_pages = page_size >> PAGE_SHIFT;
	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);
	lock_page_cgroup(pc);
	if (unlikely(PageCgroupUsed(pc))) {
	if (unlikely(PageCgroupUsed(pc))) {
		unlock_page_cgroup(pc);
		unlock_page_cgroup(pc);