All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 12/12] xen/domain: Allocate d->vcpu[] in domain_create()
Date: Wed, 29 Aug 2018 06:10:09 -0600	[thread overview]
Message-ID: <5B868D2102000078001E301E@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <8f088499-9b4e-3732-09c6-85f26d3b941c@citrix.com>

>>> On 29.08.18 at 12:36, <andrew.cooper3@citrix.com> wrote:
> On 15/08/18 16:18, Jan Beulich wrote:
>>
>>>>> --- a/xen/common/domctl.c
>>>>> +++ b/xen/common/domctl.c
>>>>> @@ -554,16 +554,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>>>  
>>>>>          ret = -EINVAL;
>>>>>          if ( (d == current->domain) || /* no domain_pause() */
>>>>> -             (max > domain_max_vcpus(d)) )
>>>>> +             (max != d->max_vcpus) )   /* max_vcpus set up in createdomain 
> */
>>>>>              break;
>>>>>  
>>>>> -        /* Until Xenoprof can dynamically grow its vcpu-s array... */
>>>>> -        if ( d->xenoprof )
>>>>> -        {
>>>>> -            ret = -EAGAIN;
>>>>> -            break;
>>>>> -        }
>>>>> -
>>>>>          /* Needed, for example, to ensure writable p.t. state is synced. */
>>>>>          domain_pause(d);
>>>>>  
>>>>> @@ -581,38 +574,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>>>>>              }
>>>>>          }
>>>>>  
>>>>> -        /* We cannot reduce maximum VCPUs. */
>>>>> -        ret = -EINVAL;
>>>>> -        if ( (max < d->max_vcpus) && (d->vcpu[max] != NULL) )xc_domain_max_vcpus
>>>>> -            goto maxvcpu_out;
>>>>> -
>>>>> -        /*
>>>>> -         * For now don't allow increasing the vcpu count from a non-zero
>>>>> -         * value: This code and all readers of d->vcpu would otherwise need
>>>>> -         * to be converted to use RCU, but at present there's no tools side
>>>>> -         * code path that would issue such a request.
>>>>> -         */
>>>>> -        ret = -EBUSY;
>>>>> -        if ( (d->max_vcpus > 0) && (max > d->max_vcpus) )
>>>>> -            goto maxvcpu_out;
>>>>> -
>>>>>          ret = -ENOMEM;
>>>>>          online = cpupool_domain_cpumask(d);
>>>>> -        if ( max > d->max_vcpus )
>>>>> -        {
>>>>> -            struct vcpu **vcpus;
>>>>> -
>>>>> -            BUG_ON(d->vcpu != NULL);
>>>>> -            BUG_ON(d->max_vcpus != 0);
>>>>> -
>>>>> -            if ( (vcpus = xzalloc_array(struct vcpu *, max)) == NULL )
>>>>> -                goto maxvcpu_out;
>>>>> -
>>>>> -            /* Install vcpu array /then/ update max_vcpus. */
>>>>> -            d->vcpu = vcpus;
>>>>> -            smp_wmb();
>>>>> -            d->max_vcpus = max;
>>>>> -        }
>>>>>  
>>>>>          for ( i = 0; i < max; i++ )
>>>>>          {
>>>> With all of this dropped, I think the domctl should be renamed. By
>>>> dropping its "max" input at the same time, there would then also
>>>> no longer be a need to check that the value matches what was
>>>> stored during domain creation.
>>> I'm still looking to eventually delete the hypercall, but we need to be
>>> able to clean up all domain/vcpu allocations without calling
>>> complete_domain_destroy, or rearrange the entry logic so
>>> complete_domain_destroy() can be reused for a domain which isn't
>>> currently in the domlist.
>>>
>>> Unfortunately, I think this is going to be fairly complicated, I think.
>> Especially when we expect this to take some time, I think it would
>> be quite helpful for the domctl to actually say what it does until
>> then, rather than retaining its current (then misleading) name.
> 
> Renaming the domctl means renaming xc_domain_max_vcpus(), and the
> python/ocaml stubs, the latter of which does have external users.

This is an option, but the libxc and higher layer functions could as well
be left alone, perhaps with a comment added to the function you name
explaining why its name doesn't match the domctl it uses.

Jan



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

  reply	other threads:[~2018-08-29 12:10 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 10:00 [PATCH v2 00/12] Improvements to domain creation Andrew Cooper
2018-08-13 10:00 ` [PATCH v2 01/12] tools/ocaml: Pass a full domctl_create_config into stub_xc_domain_create() Andrew Cooper
2018-08-13 10:00 ` [PATCH v2 02/12] tools: Rework xc_domain_create() to take a full xen_domctl_createdomain Andrew Cooper
2018-08-13 10:01 ` [PATCH v2 03/12] xen/domctl: Merge set_max_evtchn into createdomain Andrew Cooper
2018-08-14 13:58   ` Roger Pau Monné
2018-08-13 10:01 ` [PATCH v2 04/12] xen/evtchn: Pass max_evtchn_port into evtchn_init() Andrew Cooper
2018-08-14 14:07   ` Roger Pau Monné
2018-08-15 12:45   ` Jan Beulich
2018-08-15 12:57   ` Julien Grall
2018-08-13 10:01 ` [PATCH v2 05/12] tools: Pass grant table limits to XEN_DOMCTL_set_gnttab_limits Andrew Cooper
2018-08-13 10:01 ` [PATCH v2 06/12] xen/gnttab: Pass max_{grant, maptrack}_frames into grant_table_create() Andrew Cooper
2018-08-14 14:17   ` Roger Pau Monné
2018-08-15 12:51   ` Jan Beulich
2018-08-15 13:04   ` Julien Grall
2018-08-15 13:08     ` Andrew Cooper
2018-08-15 13:32       ` Julien Grall
2018-08-15 19:03         ` Andrew Cooper
2018-08-16  8:59           ` Julien Grall
2018-08-29  9:38   ` [PATCH v3 6/12] " Andrew Cooper
2018-08-30 19:40     ` Julien Grall
2018-08-13 10:01 ` [PATCH v2 07/12] xen/domctl: Remove XEN_DOMCTL_set_gnttab_limits Andrew Cooper
2018-08-14 14:19   ` Roger Pau Monné
2018-08-13 10:01 ` [PATCH v2 08/12] xen/gnttab: Fold grant_table_{create, set_limits}() into grant_table_init() Andrew Cooper
2018-08-14 14:31   ` Roger Pau Monné
2018-08-15 12:54   ` Jan Beulich
2018-08-13 10:01 ` [PATCH v2 09/12] xen/domain: Call arch_domain_create() as early as possible in domain_create() Andrew Cooper
2018-08-14 14:37   ` Roger Pau Monné
2018-08-15 12:56   ` Jan Beulich
2018-09-04 18:44   ` Rats nest with domain pirq initialisation Andrew Cooper
2018-09-05  7:24     ` Jan Beulich
2018-09-05 11:38       ` Jan Beulich
2018-09-05 12:04       ` Andrew Cooper
2018-09-05 12:25         ` Jan Beulich
2018-09-05 12:39           ` Andrew Cooper
2018-09-05 15:44             ` Roger Pau Monné
2018-08-13 10:01 ` [PATCH v2 10/12] tools: Pass max_vcpus to XEN_DOMCTL_createdomain Andrew Cooper
2018-08-13 10:01 ` [PATCH v2 11/12] xen/dom0: Arrange for dom0_cfg to contain the real max_vcpus value Andrew Cooper
2018-08-14 15:05   ` Roger Pau Monné
2018-08-15 12:59   ` Jan Beulich
2018-08-13 10:01 ` [PATCH v2 12/12] xen/domain: Allocate d->vcpu[] in domain_create() Andrew Cooper
2018-08-14 15:17   ` Roger Pau Monné
2018-08-15 13:17     ` Julien Grall
2018-08-15 13:50       ` Andrew Cooper
2018-08-15 13:52         ` Julien Grall
2018-08-15 13:56           ` Andrew Cooper
2018-08-15 13:11   ` Jan Beulich
2018-08-15 14:03     ` Andrew Cooper
2018-08-15 15:18       ` Jan Beulich
2018-08-29 10:36         ` Andrew Cooper
2018-08-29 12:10           ` Jan Beulich [this message]
2018-08-29 12:29             ` Andrew Cooper
2018-08-29 12:49               ` Jan Beulich
2018-08-29 14:40   ` [PATCH v3 " Andrew Cooper
2018-08-29 15:03     ` Jan Beulich
2018-08-31 10:33       ` Wei Liu
2018-08-31 10:42         ` Jan Beulich
2018-08-31 10:57           ` Julien Grall
2018-08-31 11:00             ` Juergen Gross
2018-08-31 10:58           ` Andrew Cooper
2018-08-30 19:46     ` Julien Grall
2018-08-30 20:04       ` Andrew Cooper
2018-08-14 13:12 ` [PATCH v2 00/12] Improvements to domain creation Christian Lindig
2018-08-14 13:34   ` Andrew Cooper

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=5B868D2102000078001E301E@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.