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

Re: [PATCH v7 5/7] xen/cpupool: Don't allow removing cpu0 from cpupool0


  • To: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 20 Apr 2022 14:57:52 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qcSxRGKWIyXVsTcm+6OyqMKTxR49DC5OvdmGcWW3kc4=; b=dNKuSQYFEl/9kf2z4QMNZ7GgsR+jiAwQIZWhAj2hJApwCFSKAlXyCxDUS7gHbQBP9U5ULr8qIZx49n98ncyJCKgTkAOtQl7bbsNAa4zkCFVg08fnvTgVHFPaYNbOcxrrDSm0E5xRqXBk/gyklqCqDFXcaqT7Bm0IUDmW5yup/hPSlyfEoxnSPLGIsDengTnykEUuKsL2QchwRkDEtlBOt1n2Fq5FYGeJZ9KfX9y218CM/DTldWPFZol+h7iNgRM4Hf/AXcjtwrGQnazvKwjPZxxhHOkG5+4xWiPx1J2s69khzlwEJ5feSLclTSq+9n8PQZzCTTkWisZhmxRwlVDJmQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bOa/VGOJWx0PPwZCJJXESkOSnpXn0ytqpCCO8SwyuipQofZKuNvLTikdLIQya/4MzedZAjfkHSIfrK7xxcDbd3vfBzpf6qU0bJnytD1HuVgWKg+4TrmHuO3LXFIrtwCFcD8NeEjjCnsFFpDJ9bL36TNDShJoQyhq0T2SL9QhgwNHelht4dTi5cck6xHQ9+HXTolDyFclXZ7P2GTsqvW/aWpcEx0Ulb4Oz6ImHG8ji2BSKx7pqr3tpTLCW0iif9Bq71MJ332cNVzHyEZ3zZX/PPUfhUSjhLlcQSgsL41eKKEzz2ewMpfiCaenD0ppCAwnpbWsKCoSZJPAfTHgkU+wIA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Wed, 20 Apr 2022 14:58:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYTbfhTkT1+2FTCUa/iQjDpfI7J6z48pQA
  • Thread-topic: [PATCH v7 5/7] xen/cpupool: Don't allow removing cpu0 from cpupool0


> On 11 Apr 2022, at 16:20, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> Cpu0 must remain in cpupool0, otherwise some operations like moving cpus
> between cpupools, cpu hotplug, destroying cpupools, shutdown of the host,
> might not work in a sane way.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> Changes in v7:
> - new patch
> ---
> xen/common/sched/cpupool.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
> index 86a175f99cd5..0a93bcc631bf 100644
> --- a/xen/common/sched/cpupool.c
> +++ b/xen/common/sched/cpupool.c
> @@ -572,6 +572,7 @@ static long cf_check cpupool_unassign_cpu_helper(void 
> *info)
>  * possible failures:
>  * - last cpu and still active domains in cpupool
>  * - cpu just being unplugged
> + * - Attempt to remove boot cpu from cpupool0
>  */
> static int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
> {
> @@ -582,7 +583,12 @@ static int cpupool_unassign_cpu(struct cpupool *c, 
> unsigned int cpu)
>     debugtrace_printk("cpupool_unassign_cpu(pool=%u,cpu=%d)\n",
>                       c->cpupool_id, cpu);
> 
> -    if ( !cpu_online(cpu) )
> +    /*
> +     * Cpu0 must remain in cpupool0, otherwise some operations like moving 
> cpus
> +     * between cpupools, cpu hotplug, destroying cpupools, shutdown of the 
> host,
> +     * might not work in a sane way.
> +     */
> +    if ( (!c->cpupool_id && !cpu) || !cpu_online(cpu) )
>         return -EINVAL;
> 
>     master_cpu = sched_get_resource_cpu(cpu);
> -- 
> 2.17.1
> 

Hi,

I’m going to address the comment on this serie before re-pushing it, I see there
are no comments on this patch, so I’m wondering, when you have time, if you
can give me some feedback on this one.

Cheers,
Luca

 


Rackspace

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