* [Xen-devel] [PATCH] xen/sched: fix resuming from S3 with smt=0
@ 2020-01-05 12:33 Juergen Gross
2020-01-08 12:44 ` George Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2020-01-05 12:33 UTC (permalink / raw)
To: xen-devel; +Cc: Juergen Gross, George Dunlap, Dario Faggioli
When resuming from S3 and smt=0 or maxcpus= are specified we must not
do anything in cpu_schedule_callback(). This is not true today for
taking down a cpu during resume.
If anything goes wrong during resume all the scheduler related error
handling is in cpupool.c, so we can just bail out early from
cpu_schedule_callback() when suspending or resuming.
This fixes commit 0763cd2687897b55e7 ("xen/sched: don't disable
scheduler on cpus during suspend").
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
xen/common/schedule.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e70cc70a65..54a07ff9e8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -2562,6 +2562,13 @@ static int cpu_schedule_callback(
unsigned int cpu = (unsigned long)hcpu;
int rc = 0;
+ /*
+ * All scheduler related suspend/resume handling needed is done in
+ * cpupool.c.
+ */
+ if ( system_state > SYS_STATE_active )
+ return NOTIFY_DONE;
+
rcu_read_lock(&sched_res_rculock);
/*
@@ -2589,8 +2596,7 @@ static int cpu_schedule_callback(
switch ( action )
{
case CPU_UP_PREPARE:
- if ( system_state != SYS_STATE_resume )
- rc = cpu_schedule_up(cpu);
+ rc = cpu_schedule_up(cpu);
break;
case CPU_DOWN_PREPARE:
rcu_read_lock(&domlist_read_lock);
@@ -2598,13 +2604,10 @@ static int cpu_schedule_callback(
rcu_read_unlock(&domlist_read_lock);
break;
case CPU_DEAD:
- if ( system_state == SYS_STATE_suspend )
- break;
sched_rm_cpu(cpu);
break;
case CPU_UP_CANCELED:
- if ( system_state != SYS_STATE_resume )
- cpu_schedule_down(cpu);
+ cpu_schedule_down(cpu);
break;
default:
break;
--
2.16.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Xen-devel] [PATCH] xen/sched: fix resuming from S3 with smt=0
2020-01-05 12:33 [Xen-devel] [PATCH] xen/sched: fix resuming from S3 with smt=0 Juergen Gross
@ 2020-01-08 12:44 ` George Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2020-01-08 12:44 UTC (permalink / raw)
To: Juergen Gross, xen-devel; +Cc: George Dunlap, Dario Faggioli
On 1/5/20 12:33 PM, Juergen Gross wrote:
> When resuming from S3 and smt=0 or maxcpus= are specified we must not
> do anything in cpu_schedule_callback(). This is not true today for
> taking down a cpu during resume.
>
> If anything goes wrong during resume all the scheduler related error
> handling is in cpupool.c, so we can just bail out early from
> cpu_schedule_callback() when suspending or resuming.
>
> This fixes commit 0763cd2687897b55e7 ("xen/sched: don't disable
> scheduler on cpus during suspend").
>
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-08 12:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-05 12:33 [Xen-devel] [PATCH] xen/sched: fix resuming from S3 with smt=0 Juergen Gross
2020-01-08 12:44 ` George Dunlap
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.