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

Re: [Xen-devel] [PATCH] xen/smp: Use die_complete completion when taking CPU down



* Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:

> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 8650cdb..4da0008 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -498,6 +498,7 @@ static int xen_cpu_disable(void)
>       if (cpu == 0)
>               return -EBUSY;
>  
> +     init_completion(&per_cpu(die_complete, smp_processor_id()));
>       cpu_disable_common();
>  
>       load_cr3(swapper_pg_dir);
> @@ -510,6 +511,9 @@ static void xen_cpu_die(unsigned int cpu)
>               current->state = TASK_UNINTERRUPTIBLE;
>               schedule_timeout(HZ/10);
>       }
> +
> +     wait_for_completion_timeout(&per_cpu(die_complete, cpu), HZ);
> +
>       xen_smp_intr_free(cpu);
>       xen_uninit_lock_cpu(cpu);
>       xen_teardown_timer(cpu);

So why not put it into cpu_disable_common() and do the same 
change for native_cpu_disable()?

Likewise, the waiting bit should be put into a common function as 
well (newly introduced, if need to be), we don't want to expose 
internal x86 core data structures to the Xen guest code.

Thanks,

        Ingo

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


 


Rackspace

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