Re: [PATCH RFC] hotplug-memory: refactor online_pages to separatezone growth from page onlining

From: Dave Hansen
Date: Sat Mar 29 2008 - 12:06:49 EST


On Fri, 2008-03-28 at 19:08 -0700, Jeremy Fitzhardinge wrote:
> My big remaining problem is how to disable the sysfs interface for this
> memory. I need to prevent any onlining via /sys/device/system/memory.

I've been thinking about this some more, and I wish that you wouldn't
just throw this interface away or completely disable it. It actually
does *exactly* what you want in a way. :)

When the /memoryXX/ directory appears, that means that the hardware has
found the memory, and that the 'struct page' is allocated and ready to
be initialized.

When the OS actually wants to use the memory (initialize the 'struct
page', and free_page() it), it does the 'echo online > /sys...'. Both
the 'struct page' and the memory represented by it are untouched until
the "online". This was originally in place to avoid fragmenting it
immediately in the case that the system did not need it.

To me, it sounds like the only different thing that you want is to make
sure that only partial sections are onlined. So, shall we work with the
existing interfaces to online partial sections, or will we just disable
it entirely when we see Xen?

For Xen and KVM, how does it get decided that the guest needs more
memory? Is this guest or host driven? Both? How is the guest
notified? Is guest userspace involved at all?

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