All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: "Juergen Gross" <jgross@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 4/6] xen: don't free percpu areas during suspend
Date: Thu, 28 Mar 2019 13:06:56 +0100	[thread overview]
Message-ID: <20190328120658.11083-5-jgross@suse.com> (raw)
In-Reply-To: <20190328120658.11083-1-jgross@suse.com>

Instead of freeing percpu areas during suspend and allocating them
again when resuming keep them. Only free an area in case a cpu didn't
come up again when resuming.

It should be noted that there is a potential change in behaviour as
the percpu areas are no longer zeroed out during suspend/resume. While
I have checked the called cpu notifier hooks to cope with that there
might be some well hidden dependency on the previous behaviour. OTOH
a component not registering itself for cpu down/up and expecting to
see a zeroed percpu variable after suspend/resume is kind of broken
already. And the opposite case, where a component is not registered
to be called for cpu down/up and is not expecting a percpu variable
suddenly to be zero due to suspend/resume is much more probable,
especially as the suspend/resume functionality seems not to be tested
that often.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
---
 xen/arch/x86/percpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 8be4ebddf4..5ea14b6ec3 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -76,7 +76,8 @@ static int cpu_percpu_callback(
         break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
-        if ( !park_offline_cpus )
+    case CPU_RESUME_FAILED:
+        if ( !park_offline_cpus && system_state != SYS_STATE_suspend )
             free_percpu_area(cpu);
         break;
     case CPU_REMOVE:
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-03-28 12:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 12:06 [PATCH v2 0/6] xen: simplify suspend/resume handling Juergen Gross
2019-03-28 12:06 ` [PATCH v2 1/6] xen/sched: call cpu_disable_scheduler() via cpu notifier Juergen Gross
2019-03-29 17:19   ` Dario Faggioli
2019-04-01 10:34   ` Julien Grall
2019-03-28 12:06 ` [PATCH v2 2/6] xen: add helper for calling notifier_call_chain() to common/cpu.c Juergen Gross
2019-03-29 17:33   ` Dario Faggioli
2019-03-28 12:06 ` [PATCH v2 3/6] xen: add new cpu notifier action CPU_RESUME_FAILED Juergen Gross
2019-03-28 12:06 ` Juergen Gross [this message]
2019-03-28 13:39   ` [PATCH v2 4/6] xen: don't free percpu areas during suspend Jan Beulich
2019-03-28 12:06 ` [PATCH v2 5/6] xen/cpupool: simplify suspend/resume handling Juergen Gross
2019-03-28 12:06 ` [PATCH v2 6/6] xen/sched: don't disable scheduler on cpus during suspend Juergen Gross
2019-03-29 17:36   ` Dario Faggioli
2019-03-28 13:01 ` [PATCH v2 0/6] xen: simplify suspend/resume handling Volodymyr Babchuk
2019-03-28 13:21   ` Juergen Gross
2019-03-28 13:23     ` Julien Grall
2019-03-28 13:34     ` Volodymyr Babchuk
2019-03-28 13:33   ` Julien Grall
2019-03-28 13:37     ` Juergen Gross
2019-03-28 13:49       ` Julien Grall
2019-03-28 13:56     ` Volodymyr Babchuk
2019-03-28 14:43       ` Julien Grall
2019-03-28 14:53       ` Dario Faggioli
2019-03-28 14:57         ` Volodymyr Babchuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190328120658.11083-5-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.