cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: reset to root_mem_cgroup at bypassing
@ 2011-12-19  7:51 KAMEZAWA Hiroyuki
  2011-12-19 20:49 ` Hugh Dickins
       [not found] ` <20111219165146.4d72f1bb.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
  0 siblings, 2 replies; 11+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-12-19  7:51 UTC (permalink / raw)
  To: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, Michal Hocko,
	Hugh Dickins

From d620ff605a3a592c2b1de3a046498ce5cd3d3c50 Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Date: Mon, 19 Dec 2011 16:55:10 +0900
Subject: [PATCH 2/2] memcg: reset lru to root_mem_cgroup in special cases.

This patch is a fix for memcg-simplify-lru-handling-by-new-rule.patch

After the patch, all pages which will be onto LRU must have sane
pc->mem_cgroup. But, in special case, it's not set.

If task->mm is NULL or task is TIF_MEMDIE or fatal_signal_pending(),
try_charge() is bypassed and the new charge will not be charged. And
pc->mem_cgroup is unset even if the page will be used/mapped and added
to LRU. To avoid this,  this patch charges such pages to root_mem_cgroup,
then, pc->mem_cgroup will be handled correctly.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0d6d21c..9268e8e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2324,7 +2324,7 @@ nomem:
 	*ptr = NULL;
 	return -ENOMEM;
 bypass:
-	*ptr = NULL;
+	*ptr = root_mem_cgroup;
 	return 0;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-12-21 12:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-19  7:51 [PATCH] memcg: reset to root_mem_cgroup at bypassing KAMEZAWA Hiroyuki
2011-12-19 20:49 ` Hugh Dickins
2011-12-20  0:24   ` Hiroyuki Kamezawa
2011-12-21  0:13     ` KAMEZAWA Hiroyuki
     [not found]       ` <20111221091347.4f1a10d8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21  3:25         ` Hugh Dickins
2011-12-21  4:00           ` KAMEZAWA Hiroyuki
     [not found] ` <20111219165146.4d72f1bb.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21  8:24   ` [PATCH v2] memcg: return -EINTR at bypassing try_charge() KAMEZAWA Hiroyuki
2011-12-21  9:57     ` Johannes Weiner
     [not found]       ` <20111221095708.GE3870-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2011-12-21 10:08         ` KAMEZAWA Hiroyuki
     [not found]     ` <20111221172423.5d036cdd.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 10:29       ` [PATCH v3] " KAMEZAWA Hiroyuki
     [not found]         ` <20111221192934.2751f8f1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 12:28           ` Johannes Weiner

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 NNTP newsgroup(s).