* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-04-30 0:06 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-04-30 0:06 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Balbir Singh, KOSAKI Motohiro, linux-kernel, linux-mm
On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
Hugh Dickins <hugh@veritas.com> wrote:
> 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.
>
Ouch, it's curious this bug alive now.. thank you.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
I think this patch itself is sane but.. Balbir, could you see "caller" ?
It seems strange.
> 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;
> }
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
2009-04-30 0:06 ` KAMEZAWA Hiroyuki
@ 2009-04-30 4:52 ` Balbir Singh
-1 siblings, 0 replies; 12+ messages in thread
From: Balbir Singh @ 2009-04-30 4:52 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Hugh Dickins, Andrew Morton, KOSAKI Motohiro, linux-kernel, linux-mm
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-30 09:06:46]:
> On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> Hugh Dickins <hugh@veritas.com> wrote:
>
> > 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.
> >
> Ouch, it's curious this bug alive now.. thank you.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> I think this patch itself is sane but.. Balbir, could you see "caller" ?
> It seems strange.
Ideally we need to have a disabled check in
mem_cgroup_update_mapped_file_stat(), but it seems as if this fix is
better and fixes a larger scenario and the root cause of
lookup_page_cgroup() OOPSing. It would not hurt to check for
mem_cgroup_disabled() though, but too many checks might spoil the
party for frequent operations.
Kame, do you mean you wanted me to check if I am using
lookup_page_cgroup() correctly?
Hugh, Thank you very much for finding and fixing the problem!
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
--
Balbir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-04-30 4:52 ` Balbir Singh
0 siblings, 0 replies; 12+ messages in thread
From: Balbir Singh @ 2009-04-30 4:52 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Hugh Dickins, Andrew Morton, KOSAKI Motohiro, linux-kernel, linux-mm
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-30 09:06:46]:
> On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> Hugh Dickins <hugh@veritas.com> wrote:
>
> > 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.
> >
> Ouch, it's curious this bug alive now.. thank you.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> I think this patch itself is sane but.. Balbir, could you see "caller" ?
> It seems strange.
Ideally we need to have a disabled check in
mem_cgroup_update_mapped_file_stat(), but it seems as if this fix is
better and fixes a larger scenario and the root cause of
lookup_page_cgroup() OOPSing. It would not hurt to check for
mem_cgroup_disabled() though, but too many checks might spoil the
party for frequent operations.
Kame, do you mean you wanted me to check if I am using
lookup_page_cgroup() correctly?
Hugh, Thank you very much for finding and fixing the problem!
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
--
Balbir
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
2009-04-30 4:52 ` Balbir Singh
@ 2009-04-30 8:27 ` KAMEZAWA Hiroyuki
-1 siblings, 0 replies; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-04-30 8:27 UTC (permalink / raw)
To: balbir
Cc: Hugh Dickins, Andrew Morton, KOSAKI Motohiro, linux-kernel, linux-mm
On Thu, 30 Apr 2009 10:22:40 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-30 09:06:46]:
>
> > On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> > Hugh Dickins <hugh@veritas.com> wrote:
> >
> > > 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.
> > >
> > Ouch, it's curious this bug alive now.. thank you.
> >
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> > I think this patch itself is sane but.. Balbir, could you see "caller" ?
> > It seems strange.
>
> Ideally we need to have a disabled check in
> mem_cgroup_update_mapped_file_stat(), but it seems as if this fix is
> better and fixes a larger scenario and the root cause of
> lookup_page_cgroup() OOPSing. It would not hurt to check for
> mem_cgroup_disabled() though, but too many checks might spoil the
> party for frequent operations.
>
> Kame, do you mean you wanted me to check if I am using
> lookup_page_cgroup() correctly?
>
Yes. I have no complaints to this patch but just curious.
Anyway thanks.
Regards,
-Kame
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-04-30 8:27 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-04-30 8:27 UTC (permalink / raw)
To: balbir
Cc: Hugh Dickins, Andrew Morton, KOSAKI Motohiro, linux-kernel, linux-mm
On Thu, 30 Apr 2009 10:22:40 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-04-30 09:06:46]:
>
> > On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> > Hugh Dickins <hugh@veritas.com> wrote:
> >
> > > 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.
> > >
> > Ouch, it's curious this bug alive now.. thank you.
> >
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> > I think this patch itself is sane but.. Balbir, could you see "caller" ?
> > It seems strange.
>
> Ideally we need to have a disabled check in
> mem_cgroup_update_mapped_file_stat(), but it seems as if this fix is
> better and fixes a larger scenario and the root cause of
> lookup_page_cgroup() OOPSing. It would not hurt to check for
> mem_cgroup_disabled() though, but too many checks might spoil the
> party for frequent operations.
>
> Kame, do you mean you wanted me to check if I am using
> lookup_page_cgroup() correctly?
>
Yes. I have no complaints to this patch but just curious.
Anyway thanks.
Regards,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
2009-04-30 0:06 ` KAMEZAWA Hiroyuki
@ 2009-05-01 13:55 ` Hugh Dickins
-1 siblings, 0 replies; 12+ messages in thread
From: Hugh Dickins @ 2009-05-01 13:55 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Andrew Morton, Balbir Singh, KOSAKI Motohiro, linux-kernel, linux-mm
On Thu, 30 Apr 2009, KAMEZAWA Hiroyuki wrote:
> On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> Hugh Dickins <hugh@veritas.com> wrote:
>
> > 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.
> >
> Ouch, it's curious this bug alive now.. thank you.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> I think this patch itself is sane but.. Balbir, could you see "caller" ?
> It seems strange.
I agree with you, it seems strange for it to come alive only now;
but I've not investigated further, may I leave that to you?
Could it be that all those checks on NULL lookup_page_cgroup()
actually date from before you reworked page cgroup assignment,
and they're now redundant? If so, you'd do better to remove
all the checks, and Balbir put an explicit check in his code.
Alternatively, could the SPARSEMEM case have been corrupting or
otherwise misbehaving in a hidden way until now? Seems unlikely.
Hugh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-05-01 13:55 ` Hugh Dickins
0 siblings, 0 replies; 12+ messages in thread
From: Hugh Dickins @ 2009-05-01 13:55 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Andrew Morton, Balbir Singh, KOSAKI Motohiro, linux-kernel, linux-mm
On Thu, 30 Apr 2009, KAMEZAWA Hiroyuki wrote:
> On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> Hugh Dickins <hugh@veritas.com> wrote:
>
> > 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.
> >
> Ouch, it's curious this bug alive now.. thank you.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> I think this patch itself is sane but.. Balbir, could you see "caller" ?
> It seems strange.
I agree with you, it seems strange for it to come alive only now;
but I've not investigated further, may I leave that to you?
Could it be that all those checks on NULL lookup_page_cgroup()
actually date from before you reworked page cgroup assignment,
and they're now redundant? If so, you'd do better to remove
all the checks, and Balbir put an explicit check in his code.
Alternatively, could the SPARSEMEM case have been corrupting or
otherwise misbehaving in a hidden way until now? Seems unlikely.
Hugh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
2009-05-01 13:55 ` Hugh Dickins
@ 2009-05-01 15:32 ` Balbir Singh
-1 siblings, 0 replies; 12+ messages in thread
From: Balbir Singh @ 2009-05-01 15:32 UTC (permalink / raw)
To: Hugh Dickins
Cc: KAMEZAWA Hiroyuki, Andrew Morton, KOSAKI Motohiro, linux-kernel,
linux-mm
* Hugh Dickins <hugh@veritas.com> [2009-05-01 14:55:51]:
> On Thu, 30 Apr 2009, KAMEZAWA Hiroyuki wrote:
> > On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> > Hugh Dickins <hugh@veritas.com> wrote:
> >
> > > 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.
> > >
> > Ouch, it's curious this bug alive now.. thank you.
> >
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> > I think this patch itself is sane but.. Balbir, could you see "caller" ?
> > It seems strange.
>
> I agree with you, it seems strange for it to come alive only now;
> but I've not investigated further, may I leave that to you?
>
> Could it be that all those checks on NULL lookup_page_cgroup()
> actually date from before you reworked page cgroup assignment,
> and they're now redundant? If so, you'd do better to remove
> all the checks, and Balbir put an explicit check in his code.
>
I agree, it needs investigation. I would propose converting them to a
VM_BUG_ON() and then consider removing them, just to catch potential
problems, in case we miss anything.
> Alternatively, could the SPARSEMEM case have been corrupting or
> otherwise misbehaving in a hidden way until now? Seems unlikely.
Agreed.
--
Balbir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH mmotm] memcg: fix mem_cgroup_update_mapped_file_stat oops
@ 2009-05-01 15:32 ` Balbir Singh
0 siblings, 0 replies; 12+ messages in thread
From: Balbir Singh @ 2009-05-01 15:32 UTC (permalink / raw)
To: Hugh Dickins
Cc: KAMEZAWA Hiroyuki, Andrew Morton, KOSAKI Motohiro, linux-kernel,
linux-mm
* Hugh Dickins <hugh@veritas.com> [2009-05-01 14:55:51]:
> On Thu, 30 Apr 2009, KAMEZAWA Hiroyuki wrote:
> > On Wed, 29 Apr 2009 22:13:33 +0100 (BST)
> > Hugh Dickins <hugh@veritas.com> wrote:
> >
> > > 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.
> > >
> > Ouch, it's curious this bug alive now.. thank you.
> >
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> > I think this patch itself is sane but.. Balbir, could you see "caller" ?
> > It seems strange.
>
> I agree with you, it seems strange for it to come alive only now;
> but I've not investigated further, may I leave that to you?
>
> Could it be that all those checks on NULL lookup_page_cgroup()
> actually date from before you reworked page cgroup assignment,
> and they're now redundant? If so, you'd do better to remove
> all the checks, and Balbir put an explicit check in his code.
>
I agree, it needs investigation. I would propose converting them to a
VM_BUG_ON() and then consider removing them, just to catch potential
problems, in case we miss anything.
> Alternatively, could the SPARSEMEM case have been corrupting or
> otherwise misbehaving in a hidden way until now? Seems unlikely.
Agreed.
--
Balbir
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread