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

Re: [PATCH v2] domain: skip more stuff for idle's vCPU-s in vcpu_create()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 17 Feb 2026 12:04:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=q0zerrpf6mTVoRwJ8KUPfcu9RrHiTpY7VL3BXCy1YEM=; b=YJrYJyxeYQGk3r7agPZ6+lwdzUKENivBXlTO+BQG227BUScPMc7/z7iS4b8A/i3wqYqJAuLw7RyjRExfUSRgzjK9K0uRLQuSnp3QaJnFy1TdqK5bgZFktMJieGvzZm/CfMP9/m4h2G60MYjP340AD9ROn6YausyMnbVB6ZAh+GsbUGSTL3PtqGkt1C5QlBkKKuOZTz07nO1bZvBwxXrzfPVuwKuI2Vl5CS361N5EvBxRGTLtlcVP6jzIjA/Ior4BsRYW8m71J44pOZb/TY8AgtCpK0JJ8ySQt/pXA8mZI5Jn3wxjh4D8i+cl3yMEFLzeteV0Ezb24soaM3sR5xyW6Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F4lvsFuYTnRggqjzUieqXQUD0xqMNE1lThmrisVw0moZ+7vsU8QJGo+0S0raGS9bq33AKulEHPHJyBXavrvjB73Bt5UVBWpl2v/FqOEm5WA+Nq9IrGWPD+7/yl+2F0P8JN3Cedl1xTtJuhR6pFLXP9coR9MxRH6DCzaO3S0U5WaJclfMkftr0wnCeP8eMNepQj2K8x50WFE2kTBCcXeU69oWF/IgyVasIM/TVQ5UIc6eElWxb5gXWfqTf1i7afSc8vrKxCVZwt39aKibhRb1+yIejMc+Fa3zfWrnFmpYV7lSYttD9Q5NmU33zK9bF9BksMvq5O6te1nxmPf6NIksAA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Tue, 17 Feb 2026 11:04:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Feb 16, 2026 at 04:54:30PM +0100, Jan Beulich wrote:
> Nothing hypercall-related needs setting up there. Nor do we need to
> check whether the idle domain is shutting down - it never will.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> v2: Drop vmtrace_alloc_buffer() part.
> 
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -475,12 +475,6 @@ struct vcpu *vcpu_create(struct domain *
>      v->vcpu_id = vcpu_id;
>      v->dirty_cpu = VCPU_CPU_CLEAN;
>  
> -    rwlock_init(&v->virq_lock);
> -
> -    tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
> -
> -    grant_table_init_vcpu(v);
> -
>      if ( is_idle_domain(d) )
>      {
>          v->runstate.state = RUNSTATE_running;
> @@ -488,6 +482,12 @@ struct vcpu *vcpu_create(struct domain *
>      }
>      else
>      {
> +        rwlock_init(&v->virq_lock);
> +
> +        tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
> +
> +        grant_table_init_vcpu(v);
> +
>          v->runstate.state = RUNSTATE_offline;
>          v->runstate.state_entry_time = NOW();
>          set_bit(_VPF_down, &v->pause_flags);
> @@ -516,7 +516,8 @@ struct vcpu *vcpu_create(struct domain *
>      }
>  
>      /* Must be called after making new vcpu visible to for_each_vcpu(). */
> -    vcpu_check_shutdown(v);
> +    if ( !is_idle_domain(d) )
> +        vcpu_check_shutdown(v);

I would possibly leave this as-is.  I agree that the idle domain will
never shut down, but it's possibly best to needlessly call into
vcpu_check_shutdown() for the idle domain rather than adding the extra
conditional for the common case?

My Ack stands regardless.

Thanks, Roger.



 


Rackspace

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