Re: Trying to make use of hotplug memory for xen balloon driver

From: Jeremy Fitzhardinge
Date: Thu Mar 27 2008 - 18:24:20 EST


Dave Hansen wrote:
The flags being all null looks highly suspicious to me.

Once you've done an add_memory(), the new sections should show up
in /sys. Do you see them in there?

Once they show up, you can online them with:

echo online > /sys/devices/system/memory/memoryXXX/state

That's what actually goes and mucks with the 'struct zone's and the
pgdats to expand them. It will also call online_page() on the whole
range. I think you're trying to do this manually, and missing part of
it.

Hm, actually this is precisely the wrong thing to do in this case. When the balloon driver adds a new section of hotplug memory, its doing it to get the page structures, but there's no actual memory backing those pages. The memory only comes into existence on a page-by-page basis when the balloon driver gets memory from the hypervisor and attaches it to each page (the balloon driver uses online_page() on each page as its ready).

If the user does a mass online via /sys the system explodes because it onlines a large number of pages which have no backing memory. Since none of those pages can be mapped, the kernel explodes in a variety of interesting ways.

So I'd really like to inhibit the sysfs interface on these sections. Thoughts?

Thanks,
J
--
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/