xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
       [not found] <20110517214421.GD30232@router-fw-old.local.net-space.pl>
@ 2011-05-18  6:57 ` Vasiliy G Tolstov
  2011-05-18  7:21   ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Vasiliy G Tolstov @ 2011-05-18  6:57 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: ian.campbell, akpm, andi.kleen, haicheng.li, fengguang.wu, jeremy,
	konrad.wilk, dan.magenheimer, pasik, dave, wdauchy, rientjes,
	xen-devel, linux-kernel, linux-mm

On Tue, 2011-05-17 at 23:44 +0200, Daniel Kiper wrote:
> This patch applies to Linus' git tree, v2.6.39-rc7 tag with a few
> prerequisite patches available at https://lkml.org/lkml/2011/5/17/407
> and at https://lkml.org/lkml/2011/3/28/98.
> 
> Memory hotplug support for Xen balloon driver. It should be
> mentioned that hotplugged memory is not onlined automatically.
> It should be onlined by user through standard sysfs interface.
> 
> Memory could be hotplugged in following steps:
> 
>   1) dom0: xl mem-max <domU> <maxmem>
>      where <maxmem> is >= requested memory size,
> 
>   2) dom0: xl mem-set <domU> <memory>
>      where <memory> is requested memory size; alternatively memory
>      could be added by writing proper value to
>      /sys/devices/system/xen_memory/xen_memory0/target or
>      /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
> 
>   3) domU: for i in /sys/devices/system/memory/memory*/state; do \
>              [ "`cat "$i"`" = offline ] && echo online > "$i"; done
> 
> Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  drivers/xen/Kconfig   |   24 +++++++++
>  drivers/xen/balloon.c |  139 ++++++++++++++++++++++++++++++++++++++++++++++++-
>  include/xen/balloon.h |    4 ++
>  3 files changed, 165 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index a59638b..b74501e 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -9,6 +9,30 @@ config XEN_BALLOON
>  	  the system to expand the domain's memory allocation, or alternatively
>  	  return unneeded memory to the system.
>  
> +config XEN_BALLOON_MEMORY_HOTPLUG
> +	bool "Memory hotplug support for Xen balloon driver"
> +	default n
> +	depends on XEN_BALLOON && MEMORY_HOTPLUG
> +	help
> +	  Memory hotplug support for Xen balloon driver allows expanding memory
> +	  available for the system above limit declared at system startup.
> +	  It is very useful on critical systems which require long
> +	  run without rebooting.
> +
> +	  Memory could be hotplugged in following steps:
> +
> +	    1) dom0: xl mem-max <domU> <maxmem>
> +	       where <maxmem> is >= requested memory size,
> +
> +	    2) dom0: xl mem-set <domU> <memory>
> +	       where <memory> is requested memory size; alternatively memory
> +	       could be added by writing proper value to
> +	       /sys/devices/system/xen_memory/xen_memory0/target or
> +	       /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
> +
> +	    3) domU: for i in /sys/devices/system/memory/memory*/state; do \
> +	               [ "`cat "$i"`" = offline ] && echo online > "$i"; done
> +
Very good. Is that possible to eliminate step 3 ? And do it automatic if
domU runs with specific xen balloon param?

-- 
> 
> Vasiliy G Tolstov <v.tolstov@selfip.ru>
> Selfip.Ru

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
  2011-05-18  6:57 ` [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver Vasiliy G Tolstov
@ 2011-05-18  7:21   ` Ian Campbell
  2011-05-18  7:24     ` Vasiliy G Tolstov
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2011-05-18  7:21 UTC (permalink / raw)
  To: v.tolstov@selfip.ru
  Cc: Daniel Kiper, akpm@linux-foundation.org, andi.kleen@intel.com,
	haicheng.li@linux.intel.com, fengguang.wu@intel.com,
	jeremy@goop.org, konrad.wilk@oracle.com, Dan Magenheimer,
	pasik@iki.fi, dave@linux.vnet.ibm.com, wdauchy@gmail.com,
	rientjes@google.com, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org

On Wed, 2011-05-18 at 07:57 +0100, Vasiliy G Tolstov wrote:
> On Tue, 2011-05-17 at 23:44 +0200, Daniel Kiper wrote:
> > +	  Memory could be hotplugged in following steps:
> > +
> > +	    1) dom0: xl mem-max <domU> <maxmem>
> > +	       where <maxmem> is >= requested memory size,
> > +
> > +	    2) dom0: xl mem-set <domU> <memory>
> > +	       where <memory> is requested memory size; alternatively memory
> > +	       could be added by writing proper value to
> > +	       /sys/devices/system/xen_memory/xen_memory0/target or
> > +	       /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
> > +
> > +	    3) domU: for i in /sys/devices/system/memory/memory*/state; do \
> > +	               [ "`cat "$i"`" = offline ] && echo online > "$i"; done
> > +

> Very good. Is that possible to eliminate step 3 ? And do it automatic if
> domU runs with specific xen balloon param?

When we faced the same question WRT VCPU hotplug we ended up using a
udev rule. Presumably the same could be done here. In the VCPU case the
rule is:

ACTION=="add", SUBSYSTEM=="cpu", RUN+="/bin/sh -c '[ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online'"

Presumably the memory one will be broadly similar.

Ian.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
  2011-05-18  7:21   ` Ian Campbell
@ 2011-05-18  7:24     ` Vasiliy G Tolstov
  2011-05-18 10:35       ` Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Vasiliy G Tolstov @ 2011-05-18  7:24 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Daniel Kiper, akpm@linux-foundation.org, andi.kleen@intel.com,
	haicheng.li@linux.intel.com, fengguang.wu@intel.com,
	jeremy@goop.org, konrad.wilk@oracle.com, Dan Magenheimer,
	pasik@iki.fi, dave@linux.vnet.ibm.com, wdauchy@gmail.com,
	rientjes@google.com, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org

On Wed, 2011-05-18 at 08:21 +0100, Ian Campbell wrote:
> On Wed, 2011-05-18 at 07:57 +0100, Vasiliy G Tolstov wrote:
> > On Tue, 2011-05-17 at 23:44 +0200, Daniel Kiper wrote:
> > > +	  Memory could be hotplugged in following steps:
> > > +
> > > +	    1) dom0: xl mem-max <domU> <maxmem>
> > > +	       where <maxmem> is >= requested memory size,
> > > +
> > > +	    2) dom0: xl mem-set <domU> <memory>
> > > +	       where <memory> is requested memory size; alternatively memory
> > > +	       could be added by writing proper value to
> > > +	       /sys/devices/system/xen_memory/xen_memory0/target or
> > > +	       /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
> > > +
> > > +	    3) domU: for i in /sys/devices/system/memory/memory*/state; do \
> > > +	               [ "`cat "$i"`" = offline ] && echo online > "$i"; done
> > > +
> 
> > Very good. Is that possible to eliminate step 3 ? And do it automatic if
> > domU runs with specific xen balloon param?
> 
> When we faced the same question WRT VCPU hotplug we ended up using a
> udev rule. Presumably the same could be done here. In the VCPU case the
> rule is:
> 
> ACTION=="add", SUBSYSTEM=="cpu", RUN+="/bin/sh -c '[ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online'"
> 
> Presumably the memory one will be broadly similar.
> 
> Ian.
> 

Ok. very good solution. Thank's.

-- 
Vasiliy G Tolstov <v.tolstov@selfip.ru>
Selfip.Ru

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
  2011-05-18  7:24     ` Vasiliy G Tolstov
@ 2011-05-18 10:35       ` Daniel Kiper
  2011-05-18 15:06         ` [Xen-devel] " Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Kiper @ 2011-05-18 10:35 UTC (permalink / raw)
  To: Vasiliy G Tolstov
  Cc: jeremy@goop.org, xen-devel@lists.xensource.com,
	haicheng.li@linux.intel.com, konrad.wilk@oracle.com,
	linux-kernel@vger.kernel.org, Dan Magenheimer,
	dave@linux.vnet.ibm.com, Ian Campbell, linux-mm@kvack.org,
	wdauchy@gmail.com, rientjes@google.com, andi.kleen@intel.com,
	akpm@linux-foundation.org, fengguang.wu@intel.com, Daniel Kiper

On Wed, May 18, 2011 at 11:24:54AM +0400, Vasiliy G Tolstov wrote:
> On Wed, 2011-05-18 at 08:21 +0100, Ian Campbell wrote:
> > On Wed, 2011-05-18 at 07:57 +0100, Vasiliy G Tolstov wrote:
> > > On Tue, 2011-05-17 at 23:44 +0200, Daniel Kiper wrote:
> > > > +	  Memory could be hotplugged in following steps:
> > > > +
> > > > +	    1) dom0: xl mem-max <domU> <maxmem>
> > > > +	       where <maxmem> is >= requested memory size,
> > > > +
> > > > +	    2) dom0: xl mem-set <domU> <memory>
> > > > +	       where <memory> is requested memory size; alternatively memory
> > > > +	       could be added by writing proper value to
> > > > +	       /sys/devices/system/xen_memory/xen_memory0/target or
> > > > +	       /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
> > > > +
> > > > +	    3) domU: for i in /sys/devices/system/memory/memory*/state; do \
> > > > +	               [ "`cat "$i"`" = offline ] && echo online > "$i"; done
> >
> > > Very good. Is that possible to eliminate step 3 ? And do it automatic if
> > > domU runs with specific xen balloon param?
> >
> > When we faced the same question WRT VCPU hotplug we ended up using a
> > udev rule. Presumably the same could be done here. In the VCPU case the
> > rule is:
> >
> > ACTION=="add", SUBSYSTEM=="cpu", RUN+="/bin/sh -c '[ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online'"
> >
> > Presumably the memory one will be broadly similar.

Here is proper udev rule:

SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"

Konrad, could you add it to git comment and Kconfig help ???

Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xen-devel] Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
  2011-05-18 10:35       ` Daniel Kiper
@ 2011-05-18 15:06         ` Konrad Rzeszutek Wilk
  2011-05-19 19:19           ` Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-05-18 15:06 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: Vasiliy G Tolstov, jeremy@goop.org, xen-devel@lists.xensource.com,
	haicheng.li@linux.intel.com, linux-kernel@vger.kernel.org,
	Dan Magenheimer, dave@linux.vnet.ibm.com, Ian Campbell,
	linux-mm@kvack.org, wdauchy@gmail.com, rientjes@google.com,
	andi.kleen@intel.com, akpm@linux-foundation.org,
	fengguang.wu@intel.com

> Here is proper udev rule:
> 
> SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
> 
> Konrad, could you add it to git comment and Kconfig help ???

I am going to be lazy and ask you to resend this patch with that udev rule mentioned in it :-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xen-devel] Re: [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver
  2011-05-18 15:06         ` [Xen-devel] " Konrad Rzeszutek Wilk
@ 2011-05-19 19:19           ` Daniel Kiper
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Kiper @ 2011-05-19 19:19 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Daniel Kiper, Vasiliy G Tolstov, jeremy@goop.org,
	xen-devel@lists.xensource.com, haicheng.li@linux.intel.com,
	linux-kernel@vger.kernel.org, Dan Magenheimer,
	dave@linux.vnet.ibm.com, Ian Campbell, linux-mm@kvack.org,
	wdauchy@gmail.com, rientjes@google.com, andi.kleen@intel.com,
	akpm@linux-foundation.org, fengguang.wu@intel.com

On Wed, May 18, 2011 at 11:06:30AM -0400, Konrad Rzeszutek Wilk wrote:
> > Here is proper udev rule:
> >
> > SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
> >
> > Konrad, could you add it to git comment and Kconfig help ???
>
> I am going to be lazy and ask you to resend this patch with that udev rule mentioned in it :-)

OK. However, David Rientjes has some objections to "Extend memory
hotplug API to allow memory hotplug in virtual machine" patch
and I will do that after clarifying/solving some issues.

Daniel

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-19 19:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110517214421.GD30232@router-fw-old.local.net-space.pl>
2011-05-18  6:57 ` [PATCH V3] xen/balloon: Memory hotplug support for Xen balloon driver Vasiliy G Tolstov
2011-05-18  7:21   ` Ian Campbell
2011-05-18  7:24     ` Vasiliy G Tolstov
2011-05-18 10:35       ` Daniel Kiper
2011-05-18 15:06         ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-05-19 19:19           ` Daniel Kiper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).