All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 1 of 3] To be able to support arbitrary	numbers of physical cpus it was necessary to
Date: Fri, 08 Oct 2010 10:03:55 +0200	[thread overview]
Message-ID: <4CAED06B.1070504@ts.fujitsu.com> (raw)
In-Reply-To: <1286372485.23155.12849.camel@zakaz.uk.xensource.com>

On 10/06/10 15:41, Ian Campbell wrote:
> On Wed, 2010-10-06 at 12:21 +0100, Stefano Stabellini wrote:
>> On Tue, 5 Oct 2010, Juergen Gross wrote:
>>> diff -r fe3018c6976d -r cfce8e755505 tools/libxl/libxl_internal.h
>>> --- a/tools/libxl/libxl_internal.h	Mon Oct 04 12:52:14 2010 +0100
>>> +++ b/tools/libxl/libxl_internal.h	Tue Oct 05 14:19:13 2010 +0200
>>> @@ -239,7 +239,6 @@
>>>   _hidden char *libxl__domid_to_name(libxl__gc *gc, uint32_t domid);
>>>   _hidden char *libxl__poolid_to_name(libxl__gc *gc, uint32_t poolid);
>>>
>>> -
>>>     /* holds the CPUID response for a single CPUID leaf
>>>      * input contains the value of the EAX and ECX register,
>>>      * and each policy string contains a filter to apply to
>>
>> we don't need this change
>>
>>
>>> diff -r fe3018c6976d -r cfce8e755505 tools/libxl/xl_cmdimpl.c
>>> --- a/tools/libxl/xl_cmdimpl.c	Mon Oct 04 12:52:14 2010 +0100
>>> +++ b/tools/libxl/xl_cmdimpl.c	Tue Oct 05 14:19:13 2010 +0200
>>> @@ -3616,12 +3616,11 @@
>>>   static void vcpupin(char *d, const char *vcpu, char *cpu)
>>>   {
>>>       libxl_vcpuinfo *vcpuinfo;
>>> -    libxl_physinfo physinfo;
>>>       uint64_t *cpumap = NULL;
>>>
>>>       uint32_t vcpuid, cpuida, cpuidb;
>>>       char *endptr, *toka, *tokb;
>>> -    int i, nb_vcpu, cpusize;
>>> +    int i, nb_vcpu, cpusize, cpumapsize;
>>>
>>>       vcpuid = strtoul(vcpu,&endptr, 10);
>>>       if (vcpu == endptr) {
>>> @@ -3634,12 +3633,13 @@
>>>
>>>       find_domain(d);
>>>
>>> -    if (libxl_get_physinfo(&ctx,&physinfo) != 0) {
>>> -        fprintf(stderr, "libxl_get_physinfo failed.\n");
>>> +    if ((cpusize = xc_get_max_cpus(ctx.xch)) == 0) {
>>> +        fprintf(stderr, "xc_get_maxcpus failed.\n");
>>>           goto vcpupin_out1;
>>>       }
>>
>> You shouldn't be calling xc functions directly from xl_cmdimpl.c.
>> The basic rule is: libxl clients (such as xl) shouldn't need to call any
>> library functions other than libxenlight's functions.
>> You can add a libxl_get_max_cpus function though.
>
> Maybe we should add libxl_cpumap_alloc_phys which returns a libxl_cpumap
> big enough to hold all physical CPUs, there are a few places within
> libxl itself which might benefit from this, e.g. libxl_list_cpupool and
> libxl_list_vcpu both call xc_get_max_cpus and then use the result as a
> parameter to libxl_cpumap_alloc.
>
> Actually, given that libxl_cpumap is only ever used for PCPUs perhaps
> alloc should just always return a suitably sized map and there's no need
> for the size parameter to libxl_cpumap_alloc? Is there any plausible
> potential use for a libxl_cpumap of nrVCPU rather than nrPCPU ?

Currently there seems to be no demand for cpumasks larger than nrPCPU.
Changinf libxl_cpumap_alloc to allocate just the correct size seems
appropriate.
I think I'll do this in my planned cpumask rework.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

  reply	other threads:[~2010-10-08  8:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 13:45 [PATCH 0 of 3] support of cpupools in xl Juergen Gross
2010-10-05 13:45 ` [PATCH 1 of 3] To be able to support arbitrary numbers of physical cpus it was necessary to Juergen Gross
2010-10-06 11:21   ` Stefano Stabellini
2010-10-06 13:41     ` Ian Campbell
2010-10-08  8:03       ` Juergen Gross [this message]
2010-10-06 13:26   ` Ian Campbell
2010-10-05 13:45 ` [PATCH 2 of 3] support of cpupools in xl: commands and library changes Juergen Gross
2010-10-06 13:31   ` Ian Campbell
2010-10-06 13:47   ` Gianni Tedesco
2010-10-08  8:41     ` Juergen Gross
2010-10-08  8:52       ` Ian Campbell
2010-10-08  9:21         ` Gianni Tedesco
2010-10-05 13:45 ` [PATCH 3 of 3] add example cpupool config file Juergen Gross
2010-10-06 11:25   ` Stefano Stabellini

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=4CAED06B.1070504@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.