All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2] domain: skip more stuff for idle's vCPU-s in vcpu_create()
Date: Tue, 17 Feb 2026 12:04:17 +0100	[thread overview]
Message-ID: <aZRLMePmm8ehD94H@Mac.lan> (raw)
In-Reply-To: <c0aef909-b294-40af-8d24-033b28450338@suse.com>

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@suse.com>

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

> ---
> 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.


  reply	other threads:[~2026-02-17 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 15:54 [PATCH v2] domain: skip more stuff for idle's vCPU-s in vcpu_create() Jan Beulich
2026-02-17 11:04 ` Roger Pau Monné [this message]
2026-02-17 11:17   ` Jan Beulich
2026-02-17 11:46     ` Roger Pau Monné
2026-02-17 12:58       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZRLMePmm8ehD94H@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.