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

Re: [Xen-devel] [PATCH 7/7] xen/arm: Restore IRQ affinity after hotplugging a CPU



Hi Stefano,

v->processor has to be updated before the sched_move_irqs is called. Since updating v->processor is done after the 'if (v->affinity_broken)' check I had to put sched_move_irqs below, where it is.

Thanks,
Mirela

On Thu, Apr 12, 2018 at 2:20 AM, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
On Wed, 11 Apr 2018, Mirela Simonovic wrote:
> Secondary pCPUs will be offlined on system suspend and hotplugged
> on resume. When offlining secondary CPUs all interrupts targeted
> to those CPUs will be routed to the boot CPU. The boot CPU
> is responsible for finalizing suspend procedure. All wake-up
> interrupts are therefore targeted to the boot CPU. Existing code
> was missing the restoration of interrupts affinity after
> hotplugging a CPU. This patch restores the IRQ affinity after
> a CPU is hotplugged.
>
> Signed-off-by: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
> ---
>  xen/common/schedule.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 343ab6306e..e3956019bc 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -692,6 +692,7 @@ void restore_vcpu_affinity(struct domain *d)
>      for_each_vcpu ( d, v )
>      {
>          spinlock_t *lock;
> +        bool affinity_was_broken = v->affinity_broken;
>
>          ASSERT(!vcpu_runnable(v));
>
> @@ -724,6 +725,9 @@ void restore_vcpu_affinity(struct domain *d)
>          lock = vcpu_schedule_lock_irq(v);
>          v->processor = SCHED_OP(vcpu_scheduler(v), pick_cpu, v);
>          spin_unlock_irq(lock);
> +
> +        if ( affinity_was_broken )
> +            sched_move_irqs(v);
>      }
>
>      domain_update_node_affinity(d);

I am no expert of this code, but it looks correct to me. You might want
to move the setting of affinity_was_broken to inside the existing if (
v->affinity_broken ) check.

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

 


Rackspace

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