Skip to contentSkip to conversation

memcg: remove impossible conditional when committing

PATCH In review Johannes Weiner 2 participants 2 messages Feb 3, 2011

Subsystems (2)
lore
Share & tools
lore

Johannes Weiner

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 mm/memcontrol.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
mm/memcontrol.c +0 -4
index 031ff07..a145c9e 100644
@@ -2092,10 +2092,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);
Signature · 8 lines
1.7.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Thu, 3 Feb 2011 15:11:10 +0100 Johannes Weiner <[email protected]> wrote:

No callsite ever passes a NULL pointer for a struct mem_cgroup * to the committing function. There is no need to check for it.

But, could you add VM_BUG_ON(!mem) here ?

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>