Re: [BUG] set_mempolicy(MPOL_INTERLEAV) cause kernel panic

From: KAMEZAWA Hiroyuki
Date: Mon Jul 27 2009 - 21:26:19 EST


On Tue, 28 Jul 2009 10:11:57 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> On Mon, 27 Jul 2009 18:02:50 -0700 (PDT)
> David Rientjes <rientjes@xxxxxxxxxx> wrote:
>
> > On Tue, 28 Jul 2009, KAMEZAWA Hiroyuki wrote:
> >
> > > > The problem originally reported here doesn't appear to have anything to do
> > > > with hotplug, it looks like it is the result of Lee's observation that
> > > > ia64 defaults top_cpuset's mems to N_POSSIBLE, which _should_ have been
> > > > updated by cpuset_init_smp().
> > > cpuset_init_smp() just updates cpuset's mask.
> > > init's task->mems_allowed is intizialized independently from cpuset's mask.
> > >
> >
> > Presumably the bug is that N_HIGH_MEMORY is not a subset of N_ONLINE at
> > this point on ia64.
> >
> N_HIGH_MEMORY is must be subset of N_ONLINE, at the any moment. Hmm,
> I'll look into what happens in ia64 world.
>

At quick look, N_HIGH_MEMORY is set here while init. (I ignore hoplug now.)

== before init==
60 #ifndef CONFIG_NUMA
61 [N_NORMAL_MEMORY] = { { [0] = 1UL } },
62 #ifdef CONFIG_HIGHMEM
63 [N_HIGH_MEMORY] = { { [0] = 1UL } },
64 #endif
==
3860 static unsigned long __init early_calculate_totalpages(void)
3861 {
....
3869 if (pages)
3870 node_set_state(early_node_map[i].nid, N_HIGH_MEMORY);
3871 }
==
4041 void __init free_area_init_nodes(unsigned long *max_zone_pfn)
4042 {
4105 if (pgdat->node_present_pages)
4106 node_set_state(nid, N_HIGH_MEMORY);
==


All of them are done while mem_init(). Then if N_HIGH_MEMORY is not correct at
kernel_init(). It's bug.

I think what Lee and Miao pointed out is just a hotplug problem.
Ok, I'll try some patch but it'll take some hours.

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/