Re: [PATCH 2 of 4] hotplug-memory: adding non-section-alignedmemory is bad

From: Dave Hansen
Date: Fri Mar 28 2008 - 14:27:39 EST


On Fri, 2008-03-28 at 11:19 -0700, Jeremy Fitzhardinge wrote:
> KAMEZAWA Hiroyuki wrote:
> >> What would happen if I did online_pages(pfn, 1) on each page as I
> >> populate it?
> >>
> >>
> > I think (hope) it works well. But it seems no one tries to do that.
>
> Well I had immediate problems because I try to use it under spinlock and
> it calls online_pages -> build_all_zonelists -> stop_machine_run. I can
> easily rearrange to fix that, but it seems to me that stop_machine_run()
> is probably too expensive to call thousands of times (one for each page,
> rather than once per section).

Yeah, you certainly don't want to be messing with things like the zone
boundaries for each page online operation.

All that you really want to do is hook into add_one_highpage_hotplug()
and keep the pages from going back into the allocator, right? Then, you
can have the Xen code go and actually free_page() on them, later.

I don't think *any* of this code actually touches the new physical pages
themselves. The issue that you're probably seeing is because they get
stuck into the allocator and some other user grabs them right away and
*does* touch them.

-- Dave

--
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/