All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers
@ 2015-06-11 12:31 Dario Faggioli
  2015-06-11 12:46 ` Juergen Gross
  2015-06-11 14:24 ` George Dunlap
  0 siblings, 2 replies; 3+ messages in thread
From: Dario Faggioli @ 2015-06-11 12:31 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, George Dunlap, Keir Fraser, Jan Beulich,
	Tim Deegan

trying to shutdown the host when a cpupool exists, has
pCPUs, and has a scheduler different than the Xen's default
one, produces this:

 root@Zhaman:~# xl cpupool-cpu-remove Pool-0 8
 root@Zhaman:~# xl cpupool-create name=\"Pool-1\" sched=\"credit2\"
 Using config file "command line"
 cpupool name:   Pool-1
 scheduler:      credit2
 number of cpus: 0
 root@Zhaman:~# xl cpupool-cpu-add Pool-1 8
 root@Zhaman:~# shutdown -h now

 (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Not tainted ]----
 (XEN) CPU:    0
 (XEN) RIP:    e008:[<ffff82d080133bdf>] kill_timer+0x56/0x298
 (XEN) RFLAGS: 0000000000010002   CONTEXT: hypervisor
  ... ... ...
 (XEN) Xen call trace:
 (XEN)    [<ffff82d080133bdf>] kill_timer+0x56/0x298
 (XEN)    [<ffff82d08012233f>] csched_free_pdata+0x9b/0xcf
 (XEN)    [<ffff82d08012c30c>] cpu_schedule_callback+0x64/0x8b
 (XEN)    [<ffff82d08011bc7a>] notifier_call_chain+0x67/0x87
 (XEN)    [<ffff82d08010153e>] cpu_down+0xd9/0x12c
 (XEN)    [<ffff82d080101744>] disable_nonboot_cpus+0x93/0x138
 (XEN)    [<ffff82d0801aa6e7>] enter_state_helper+0xbd/0x365
 (XEN)    [<ffff82d0801061e5>] continue_hypercall_tasklet_handler+0x4a/0xb1
 (XEN)    [<ffff82d080132387>] do_tasklet_work+0x78/0xab
 (XEN)    [<ffff82d0801326bd>] do_tasklet+0x5e/0x8a
 (XEN)    [<ffff82d0801646d2>] idle_loop+0x56/0x6b
  ... ... ...
 (XEN) ****************************************
 (XEN) Panic on CPU 0:
 (XEN) FATAL PAGE FAULT
 (XEN) [error_code=0000]
 (XEN) Faulting linear address: 0000000000000041
 (XEN) ****************************************

The fix is, when tearing down a pCPU, call the free_pdata()
hook from the scheduler of the cpupool the pCPU belongs to,
not always the one from the default scheduler.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: Juergen Gross <jgross@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 6b02f98..3325ccd 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1303,9 +1303,10 @@ static int cpu_schedule_up(unsigned int cpu)
 static void cpu_schedule_down(unsigned int cpu)
 {
     struct schedule_data *sd = &per_cpu(schedule_data, cpu);
+    struct scheduler *sched = per_cpu(scheduler, cpu);
 
     if ( sd->sched_priv != NULL )
-        SCHED_OP(&ops, free_pdata, sd->sched_priv, cpu);
+        SCHED_OP(sched, free_pdata, sd->sched_priv, cpu);
 
     kill_timer(&sd->s_timer);
 }

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

* Re: [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers
  2015-06-11 12:31 [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers Dario Faggioli
@ 2015-06-11 12:46 ` Juergen Gross
  2015-06-11 14:24 ` George Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2015-06-11 12:46 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: George Dunlap, Tim Deegan, Keir Fraser, Jan Beulich

On 06/11/2015 02:31 PM, Dario Faggioli wrote:
> trying to shutdown the host when a cpupool exists, has
> pCPUs, and has a scheduler different than the Xen's default
> one, produces this:
>
>   root@Zhaman:~# xl cpupool-cpu-remove Pool-0 8
>   root@Zhaman:~# xl cpupool-create name=\"Pool-1\" sched=\"credit2\"
>   Using config file "command line"
>   cpupool name:   Pool-1
>   scheduler:      credit2
>   number of cpus: 0
>   root@Zhaman:~# xl cpupool-cpu-add Pool-1 8
>   root@Zhaman:~# shutdown -h now
>
>   (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Not tainted ]----
>   (XEN) CPU:    0
>   (XEN) RIP:    e008:[<ffff82d080133bdf>] kill_timer+0x56/0x298
>   (XEN) RFLAGS: 0000000000010002   CONTEXT: hypervisor
>    ... ... ...
>   (XEN) Xen call trace:
>   (XEN)    [<ffff82d080133bdf>] kill_timer+0x56/0x298
>   (XEN)    [<ffff82d08012233f>] csched_free_pdata+0x9b/0xcf
>   (XEN)    [<ffff82d08012c30c>] cpu_schedule_callback+0x64/0x8b
>   (XEN)    [<ffff82d08011bc7a>] notifier_call_chain+0x67/0x87
>   (XEN)    [<ffff82d08010153e>] cpu_down+0xd9/0x12c
>   (XEN)    [<ffff82d080101744>] disable_nonboot_cpus+0x93/0x138
>   (XEN)    [<ffff82d0801aa6e7>] enter_state_helper+0xbd/0x365
>   (XEN)    [<ffff82d0801061e5>] continue_hypercall_tasklet_handler+0x4a/0xb1
>   (XEN)    [<ffff82d080132387>] do_tasklet_work+0x78/0xab
>   (XEN)    [<ffff82d0801326bd>] do_tasklet+0x5e/0x8a
>   (XEN)    [<ffff82d0801646d2>] idle_loop+0x56/0x6b
>    ... ... ...
>   (XEN) ****************************************
>   (XEN) Panic on CPU 0:
>   (XEN) FATAL PAGE FAULT
>   (XEN) [error_code=0000]
>   (XEN) Faulting linear address: 0000000000000041
>   (XEN) ****************************************
>
> The fix is, when tearing down a pCPU, call the free_pdata()
> hook from the scheduler of the cpupool the pCPU belongs to,
> not always the one from the default scheduler.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>

> ---
> Cc: Juergen Gross <jgross@suse.com>
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Keir Fraser <keir@xen.org>
> ---
>   xen/common/schedule.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 6b02f98..3325ccd 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -1303,9 +1303,10 @@ static int cpu_schedule_up(unsigned int cpu)
>   static void cpu_schedule_down(unsigned int cpu)
>   {
>       struct schedule_data *sd = &per_cpu(schedule_data, cpu);
> +    struct scheduler *sched = per_cpu(scheduler, cpu);
>
>       if ( sd->sched_priv != NULL )
> -        SCHED_OP(&ops, free_pdata, sd->sched_priv, cpu);
> +        SCHED_OP(sched, free_pdata, sd->sched_priv, cpu);
>
>       kill_timer(&sd->s_timer);
>   }
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
>

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

* Re: [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers
  2015-06-11 12:31 [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers Dario Faggioli
  2015-06-11 12:46 ` Juergen Gross
@ 2015-06-11 14:24 ` George Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: George Dunlap @ 2015-06-11 14:24 UTC (permalink / raw)
  To: Dario Faggioli, xen-devel
  Cc: Juergen Gross, Tim Deegan, Keir Fraser, Jan Beulich

On 06/11/2015 01:31 PM, Dario Faggioli wrote:
> trying to shutdown the host when a cpupool exists, has
> pCPUs, and has a scheduler different than the Xen's default
> one, produces this:
> 
>  root@Zhaman:~# xl cpupool-cpu-remove Pool-0 8
>  root@Zhaman:~# xl cpupool-create name=\"Pool-1\" sched=\"credit2\"
>  Using config file "command line"
>  cpupool name:   Pool-1
>  scheduler:      credit2
>  number of cpus: 0
>  root@Zhaman:~# xl cpupool-cpu-add Pool-1 8
>  root@Zhaman:~# shutdown -h now
> 
>  (XEN) ----[ Xen-4.6-unstable  x86_64  debug=y  Not tainted ]----
>  (XEN) CPU:    0
>  (XEN) RIP:    e008:[<ffff82d080133bdf>] kill_timer+0x56/0x298
>  (XEN) RFLAGS: 0000000000010002   CONTEXT: hypervisor
>   ... ... ...
>  (XEN) Xen call trace:
>  (XEN)    [<ffff82d080133bdf>] kill_timer+0x56/0x298
>  (XEN)    [<ffff82d08012233f>] csched_free_pdata+0x9b/0xcf
>  (XEN)    [<ffff82d08012c30c>] cpu_schedule_callback+0x64/0x8b
>  (XEN)    [<ffff82d08011bc7a>] notifier_call_chain+0x67/0x87
>  (XEN)    [<ffff82d08010153e>] cpu_down+0xd9/0x12c
>  (XEN)    [<ffff82d080101744>] disable_nonboot_cpus+0x93/0x138
>  (XEN)    [<ffff82d0801aa6e7>] enter_state_helper+0xbd/0x365
>  (XEN)    [<ffff82d0801061e5>] continue_hypercall_tasklet_handler+0x4a/0xb1
>  (XEN)    [<ffff82d080132387>] do_tasklet_work+0x78/0xab
>  (XEN)    [<ffff82d0801326bd>] do_tasklet+0x5e/0x8a
>  (XEN)    [<ffff82d0801646d2>] idle_loop+0x56/0x6b
>   ... ... ...
>  (XEN) ****************************************
>  (XEN) Panic on CPU 0:
>  (XEN) FATAL PAGE FAULT
>  (XEN) [error_code=0000]
>  (XEN) Faulting linear address: 0000000000000041
>  (XEN) ****************************************
> 
> The fix is, when tearing down a pCPU, call the free_pdata()
> hook from the scheduler of the cpupool the pCPU belongs to,
> not always the one from the default scheduler.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

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

end of thread, other threads:[~2015-06-11 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 12:31 [PATCH] xen: cpupool: fix shutdown with cpupools with different schedulers Dario Faggioli
2015-06-11 12:46 ` Juergen Gross
2015-06-11 14:24 ` 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.