All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-04-29 21:13 ` Hugh Dickins
  0 siblings, 0 replies; 12+ messages in thread
From: Hugh Dickins @ 2009-04-29 21:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Balbir Singh, KAMEZAWA Hiroyuki, KOSAKI Motohiro, linux-kernel, linux-mm

CONFIG_SPARSEMEM=y CONFIG_CGROUP_MEM_RES_CTLR=y cgroup_disable=memory
bootup is oopsing in mem_cgroup_update_mapped_file_stat().  !SPARSEMEM
is fine because its lookup_page_cgroup() contains an explicit check for
NULL node_page_cgroup, but the SPARSEMEM version was missing a check for
NULL section->page_cgroup.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Should go in as a fix to
memcg-add-file-based-rss-accounting.patch
but it's curious that's the first thing to suffer from this divergence.

Perhaps this is the wrong fix, and there should be an explicit
mem_cgroup_disable() check somewhere else; but it would then seem
dangerous that SPARSEMEM and !SPARSEMEM diverge in this way,
and there are lots of lookup_page_cgroup NULL tests around.

 mm/page_cgroup.c |    2 ++
 1 file changed, 2 insertions(+)

--- 2.6.30-rc3-mm1/mm/page_cgroup.c	2009-04-29 21:01:06.000000000 +0100
+++ mmotm/mm/page_cgroup.c	2009-04-29 21:12:04.000000000 +0100
@@ -99,6 +99,8 @@ struct page_cgroup *lookup_page_cgroup(s
 	unsigned long pfn = page_to_pfn(page);
 	struct mem_section *section = __pfn_to_section(pfn);
 
+	if (!section->page_cgroup)
+		return NULL;
 	return section->page_cgroup + pfn;
 }
 

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

end of thread, other threads:[~2009-05-01 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-29 21:13 [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops Hugh Dickins
2009-04-29 21:13 ` Hugh Dickins
2009-04-30  0:06 ` KAMEZAWA Hiroyuki
2009-04-30  0:06   ` KAMEZAWA Hiroyuki
2009-04-30  4:52   ` Balbir Singh
2009-04-30  4:52     ` Balbir Singh
2009-04-30  8:27     ` KAMEZAWA Hiroyuki
2009-04-30  8:27       ` KAMEZAWA Hiroyuki
2009-05-01 13:55   ` Hugh Dickins
2009-05-01 13:55     ` Hugh Dickins
2009-05-01 15:32     ` Balbir Singh
2009-05-01 15:32       ` Balbir Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.