All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT 0/2] fixes for Xen live migration
@ 2010-06-03  8:44 Ian Campbell
  2010-06-03  8:44 ` [PATCH] xen: ensure timer tick is resumed even on CPU driving the resume Ian Campbell
  2010-06-03  8:44 ` [PATCH] xen: avoid allocation causing potential swap activity on the resume path Ian Campbell
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Campbell @ 2010-06-03  8:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Jeremy Fitzhardinge, xen-devel, stable

Hi Linus,

These changes fix a couple of issues with save/restore or migration of
Xen guests and have both been acked by Jeremy Fitzhardinge (Xen
maintainer) for sending to you direct
(http://marc.info/?l=xen-devel&m=127549692721092)

Ian.

The following changes since commit 67a3e12b05e055c0415c556a315a3d3eb637e29e:
  Linus Torvalds (1):
        Linux 2.6.35-rc1

are available in the git repository at:

  git://xenbits.xensource.com/people/ianc/linux-2.6.git for-linus/bugfixes

Ian Campbell (2):
      xen: ensure timer tick is resumed even on CPU driving the resume
      xen: avoid allocation causing potential swap activity on the resume path

 arch/x86/xen/suspend.c         |    4 ++--
 drivers/xen/xenbus/xenbus_xs.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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

* [PATCH] xen: ensure timer tick is resumed even on CPU driving the resume
  2010-06-03  8:44 [GIT 0/2] fixes for Xen live migration Ian Campbell
@ 2010-06-03  8:44 ` Ian Campbell
  2010-06-03  8:44 ` [PATCH] xen: avoid allocation causing potential swap activity on the resume path Ian Campbell
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2010-06-03  8:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: xen-devel, Ian Campbell

The core suspend/resume code is run from stop_machine on CPU0 but
parts of the suspend/resume machinery (including xen_arch_resume) are
run on whichever CPU happened to schedule the xenwatch kernel thread.

As part of the non-core resume code xen_arch_resume is called in order
to restart the timer tick on non-boot processors. The boot processor
itself is taken care of by core timekeeping code.

xen_arch_resume uses smp_call_function which does not call the given
function on the current processor. This means that we can end up with
one CPU not receiving timer ticks if the xenwatch thread happened to
be scheduled on CPU > 0.

Use on_each_cpu instead of smp_call_function to ensure the timer tick
is resumed everywhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Stable Kernel <stable@kernel.org> # .32.x
---
 arch/x86/xen/suspend.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 987267f..a9c6611 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -60,6 +60,6 @@ static void xen_vcpu_notify_restore(void *data)
 
 void xen_arch_resume(void)
 {
-	smp_call_function(xen_vcpu_notify_restore,
-			       (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
+	on_each_cpu(xen_vcpu_notify_restore,
+		    (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
 }
-- 
1.5.6.5

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

* [PATCH] xen: avoid allocation causing potential swap activity on the resume path
  2010-06-03  8:44 [GIT 0/2] fixes for Xen live migration Ian Campbell
  2010-06-03  8:44 ` [PATCH] xen: ensure timer tick is resumed even on CPU driving the resume Ian Campbell
@ 2010-06-03  8:44 ` Ian Campbell
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2010-06-03  8:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: xen-devel, Ian Campbell

Since the device we are resuming could be the device containing the
swap device we should ensure that the allocation cannot cause
IO.

On resume, this path is triggered when the running system tries to
continue using its devices.  If it cannot then the resume will fail;
to try to avoid this we let it dip into the emergency pools.

The majority of these changes were made when linux-2.6.18-xen.hg
changeset e8b49cfbdac0 was ported upstream in
a144ff09bc52ef3f3684ed23eadc9c7c0e57b3aa but somehow this hunk was
dropped.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Stable Kernel <stable@kernel.org> # .32.x
---
 drivers/xen/xenbus/xenbus_xs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index eab33f1..7b547f5 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -499,7 +499,7 @@ int xenbus_printf(struct xenbus_transaction t,
 #define PRINTF_BUFFER_SIZE 4096
 	char *printf_buffer;
 
-	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL);
+	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_NOIO | __GFP_HIGH);
 	if (printf_buffer == NULL)
 		return -ENOMEM;
 
-- 
1.5.6.5

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

end of thread, other threads:[~2010-06-03  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-03  8:44 [GIT 0/2] fixes for Xen live migration Ian Campbell
2010-06-03  8:44 ` [PATCH] xen: ensure timer tick is resumed even on CPU driving the resume Ian Campbell
2010-06-03  8:44 ` [PATCH] xen: avoid allocation causing potential swap activity on the resume path Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.