Re: + page_alloc-oops-when-setting-percpu_pagelist_fraction.patchadded to -mm tree

From: Dimitri Sivanich
Date: Wed Jun 17 2009 - 10:01:04 EST


On Wed, Jun 17, 2009 at 09:21:27AM +0900, KOSAKI Motohiro wrote:
> (switch to lkml)
>
> Sorry for late review.
>
> > mm/page_alloc.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff -puN mm/page_alloc.c~page_alloc-oops-when-setting-percpu_pagelist_fraction mm/page_alloc.c
> > --- a/mm/page_alloc.c~page_alloc-oops-when-setting-percpu_pagelist_fraction
> > +++ a/mm/page_alloc.c
> > @@ -2806,7 +2806,11 @@ static int __cpuinit process_zones(int c
> >
> > node_set_state(node, N_CPU); /* this node has a cpu */
> >
> > - for_each_populated_zone(zone) {
> > + for_each_zone(zone) {
> > + if (!populated_zone(zone)) {
> > + zone_pcp(zone, cpu) = &boot_pageset[cpu];
> > + continue;
> > + }
> > zone_pcp(zone, cpu) = kmalloc_node(sizeof(struct per_cpu_pageset),
> > GFP_KERNEL, node);
> > if (!zone_pcp(zone, cpu))
>
> I don't think this code works.
> pcp is only protected local_irq_save(), not spin lock. it assume
> each cpu have different own pcp. but this patch break this assumption.
> Now, we can share boot_pageset by multiple cpus.
>

I'm not quite understanding what you mean.

Prior to the cpu going down, each unpopulated zone pointed to the boot_pageset (per_cpu_pageset) for it's cpu (it's array element), so things had been set up this way already. I could be missing something, but am not sure why restoring this would be a risk?
--
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/