Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen guests - third fully working version

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Kiper
Date: Monday, August 16, 2010 - 8:44 am

Hi,

On Thu, Aug 12, 2010 at 05:43:33PM -0700, Jeremy Fitzhardinge wrote:

I took all relevant addresses (sorry if I missed somebody) from MAINTAINERS
file and they are in To in most of e-mails from me.


OK.


Small reminder: make CONFIG_DEBUG_SECTION_MISMATCH=y

I reviewed kernel source code once again. It is OK. Normaly it is
not allowed to reference code/data tagged as .init.* because
that sections are freed at the end of kernel boot sequence and
they do not exists any more in memory. However it is sometimes
required to use code/data marked .init.*. To allow that __ref
tag is used and then referenced objects are not removed from
memory (and no warnings are displayed during kernel compilation).


Suspend/Hibernation code in Linux Kernel is platform independent
to some extent and it does not require ACPI. It means that
lock_system_sleep/unlock_system_sleep is required in that
place to have memory state intact during suspend/hibernation.


If you wish I will do that, however then it should be changed
as well add_registered_memory() function syntax. It should
contain pointer to name published through /sys/firmware/memmap
interface. I am not sure it is good solution to change
add_registered_memory() function syntax which I think should be
same as add_memory() function syntax.


No. It supports multiple allocations. This variables are
used mostly for communication between allocate_additional_memory
and hotplug_allocated_memory functions.


For full description of current algorithm
please look at the end of this e-mail.


It is always PAGE_SIZE aligned and not below than
<max_address_of_section_allocated_at_boot> + 1.


Here is allocated min(nr_pages, ARRAY_SIZE(frame_list)) of pages.


First memory is allocated in batches of min(nr_pages, ARRAY_SIZE(frame_list))
of pages and then whole allocated memory is hotplugged.


As I know (maybe I have missed something) currently Xen does not support
NUMA in guests and nid is always 0. However maybe it will be good to create
Xen specific version of memory_add_physaddr_to_nid function.


Yes.


add_registered_memory()


This updates /sys/devices/system/memory/memory*/state files
which contain information about states of sections.


Because memory is allocated in relatively small
batches and then whole memory is hotplugged.


It was not available in Linux Kernel Ver. 2.6.32.*
on which based first versions of this patch.
It updates /sys/firmware/memmap.


Here is current algorithm:
  - allocate_resource() with size requested by user,
  - allocate memory in relatively small batches,
  - add_registered_memory(),
  - online_pages(),
  - update /sys/devices/system/memory/memory*/state files.


Currently it is.


I think that sysfs should stay intact because it contains some
useful information for admins. We should reconsider avaibilty
of /sys/devices/system/memory/probe. In physical systems it
is available however usage without real hotplug support
lead to big crash. I am not sure we should disable probe in Xen.
Maybe it is better to stay in sync with standard behavior.
Second solution is to prepare an interface (kernel option
or only some enable/disable functions) which give possibilty
to enable/disable probe interface when it is required.

Daniel
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen gue ..., Jeremy Fitzhardinge, (Thu Aug 12, 5:43 pm)
Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen gue ..., Jeremy Fitzhardinge, (Thu Aug 12, 5:46 pm)
Re: [Xen-devel] Re: [PATCH] GSoC 2010 - Memory hotplug sup ..., Jeremy Fitzhardinge, (Thu Aug 12, 5:48 pm)
Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen gue ..., Daniel Kiper, (Mon Aug 16, 8:44 am)
Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen gue ..., Jeremy Fitzhardinge, (Wed Aug 25, 2:33 pm)
Re: [PATCH] GSoC 2010 - Memory hotplug support for Xen gue ..., KAMEZAWA Hiroyuki, (Wed Aug 25, 6:23 pm)