[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/5] xen: credit2: fix shutdown/suspend when playing with cpupools.



On Tue, Jan 17, 2017 at 5:26 PM, Dario Faggioli
<dario.faggioli@xxxxxxxxxx> wrote:
> In fact, during shutdown/suspend, we temporarily move all
> the vCPUs to the BSP (i.e., pCPU 0, as of now). For Credit2
> domains, we call csched2_vcpu_migrate(), expects to find the
> target pCPU in the domain's pool
>
> Therefore, if Credit2 is the default scheduler and we have
> removed pCPU 0 from cpupool0, shutdown/suspend fails like
> this:
>
>  RIP:    e008:[<ffff82d08012906d>] sched_credit2.c#migrate+0x274/0x2d1
>  Xen call trace:
>     [<ffff82d08012906d>] sched_credit2.c#migrate+0x274/0x2d1
>     [<ffff82d080129138>] sched_credit2.c#csched2_vcpu_migrate+0x6e/0x86
>     [<ffff82d08012c468>] schedule.c#vcpu_move_locked+0x69/0x6f
>     [<ffff82d08012ec14>] cpu_disable_scheduler+0x3d7/0x430
>     [<ffff82d08019669b>] __cpu_disable+0x299/0x2b0
>     [<ffff82d0801012f8>] cpu.c#take_cpu_down+0x2f/0x38
>     [<ffff82d0801312d8>] stop_machine.c#stopmachine_action+0x7f/0x8d
>     [<ffff82d0801330b8>] tasklet.c#do_tasklet_work+0x74/0xab
>     [<ffff82d0801333ed>] do_tasklet+0x66/0x8b
>     [<ffff82d080166a73>] domain.c#idle_loop+0x3b/0x5e
>
>  ****************************************
>  Panic on CPU 8:
>  Assertion 'svc->vcpu->processor < nr_cpu_ids' failed at sched_credit2.c:1729
>  ****************************************
>
> On the other hand, if Credit2 is the scheduler of another
> pool, when trying (still during shutdown/suspend) to move
> the vCPUs of the Credit2 domains to pCPU 0, it figures
> out that pCPU 0 is not a Credit2 pCPU, and fails like this:
>
>  RIP:    e008:[<ffff82d08012916b>] 
> sched_credit2.c#csched2_vcpu_migrate+0xa1/0x107
>  Xen call trace:
>     [<ffff82d08012916b>] sched_credit2.c#csched2_vcpu_migrate+0xa1/0x107
>     [<ffff82d08012c4e9>] schedule.c#vcpu_move_locked+0x69/0x6f
>     [<ffff82d08012edfc>] cpu_disable_scheduler+0x3d7/0x430
>     [<ffff82d08019687b>] __cpu_disable+0x299/0x2b0
>     [<ffff82d0801012f8>] cpu.c#take_cpu_down+0x2f/0x38
>     [<ffff82d0801314c0>] stop_machine.c#stopmachine_action+0x7f/0x8d
>     [<ffff82d0801332a0>] tasklet.c#do_tasklet_work+0x74/0xab
>     [<ffff82d0801335d5>] do_tasklet+0x66/0x8b
>     [<ffff82d080166c53>] domain.c#idle_loop+0x3b/0x5e
>
> The solution is to recognise the specific situation, inside
> csched2_vcpu_migrate() and, considering it is something temporary,
> which only happens during shutdown/suspend, quickly deal with it.
>
> Then, in the resume path, in restore_vcpu_affinity(), things
> are set back to normal, and a new v->processor is chosen, for
> each vCPU, from the proper set of pCPUs (i.e., the ones of
> the proper cpupool).
>
> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.