* [patch] memcg: remove impossible conditional when committing
@ 2011-02-03 14:11 Johannes Weiner
2011-02-03 23:49 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Weiner @ 2011-02-03 14:11 UTC (permalink / raw
To: Andrew Morton
Cc: KAMEZAWA Hiroyuki, Daisuke Nishimura, Balbir Singh, linux-mm,
linux-kernel
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>
---
mm/memcontrol.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 031ff07..a145c9e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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);
--
1.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] memcg: remove impossible conditional when committing
2011-02-03 14:11 [patch] memcg: remove impossible conditional when committing Johannes Weiner
@ 2011-02-03 23:49 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-02-03 23:49 UTC (permalink / raw
To: Johannes Weiner
Cc: Andrew Morton, Daisuke Nishimura, Balbir Singh, linux-mm,
linux-kernel
On Thu, 3 Feb 2011 15:11:10 +0100
Johannes Weiner <hannes@cmpxchg.org> 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.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
But, could you add VM_BUG_ON(!mem) here ?
Thanks,
-Kame
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-03 23:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03 14:11 [patch] memcg: remove impossible conditional when committing Johannes Weiner
2011-02-03 23:49 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).