WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [xen-devel][vNUMA v2][PATCH 1/8] Config options

To: Andre Przywara <andre.przywara@xxxxxxx>
Subject: Re: [xen-devel][vNUMA v2][PATCH 1/8] Config options
From: Dulloor <dulloor@xxxxxxxxx>
Date: Tue, 3 Aug 2010 08:18:15 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 03 Aug 2010 08:19:04 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y2/OtGQwIbPSRj1GXPC6pQ3POmoeB2rLCFdlYRcXl+8=; b=ev+/G3bfwVAgT2upv3cw0fIfWiBGdeQtVjKd5vHXgwJ5kIuD/dSlr/ZY8RRXWXu5qQ g56+cqdz9N0X75aL61NRj6nkqh5us0Pj94wKt5+QN6ZiAW5nSpbHKfFiBCT4Xobo6sVU Zi73fNY9RfYlMSZ+tEp89HfEqz4WlGbU0McLU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gU9EyxE9ww9ugEgPV52Nyxdk80iFBvbMKbhh8YGt5IEcV4lNP6LHAyeUM2B3nY+MQZ qfmrz0rQVz6uYWGs6Zyn0UsD6VMCuvAoYbK9+AtNE4Nw4LGWBNs+pBr5Hi6OrinJpsM3 FgfeGGl6AmPp8obA/NYjpROceJp2au1rN/QqQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C580E29.1090302@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1BEA8649F0C00540AB2811D7922ECB6C9338B4CB@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <AANLkTinWRm56hJPBX1eyBhQe1eRaWN-XGu2LQW6NEeLz@xxxxxxxxxxxxxx> <AANLkTimHTLjhWCo-=VvcfETRXyX3Sa9W=B4u=hc-LjrV@xxxxxxxxxxxxxx> <4C580E29.1090302@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, Aug 3, 2010 at 5:40 AM, Andre Przywara <andre.przywara@xxxxxxx> wrote:
> Dulloor wrote:
>>
>> Implement the following config options :
>>
>> strategy = "str", where str is confine/stripe/split/auto
>> vnodes = <num-nodes>
>> stripesz = <size-in-pages>
>
> As Ian already said, I'd also prefer NUMA related names instead of
> the generic "strategy". Also "vnodes" may be a bit misleading, what about
> "guestnodes"?
That's right. How about "numa_strategy", "numa_vnodes", and "numa_stripesz" ?

>
>> +typedef struct xc_domain_numa_config
>> +{
>> +    uint32_t strategy;      /* By default, DONTCARE (for now) */
>> +    uint32_t nr_nodes;      /* For SPLIT/STRIPE */
>> +    uint32_t stripe_size;   /* For STRIPE only */
>
> Are 32 bit here sufficient? Although for the stripe size probably 4GB
> are more than needed, I'd prefer to use 64bit (or long) for each
> memory-related variable.
Here, stripe_size is in 4K pages, so effectively we have 44 bits,
which should suffice.
But, for consistency, I will change that to 64-bit.

>>
>> +} xc_domain_numa_config_t;
>> +
>
>> +++ b/tools/libxl/xl_cmdimpl.c
>> +static uint32_t numa_str_to_val(const char *str)
>> +{
>> +    if (!strcasecmp(str, "AUTO"))
>> +        return XC_DOM_NUMA_AUTO;
>> +    if (!strcasecmp(str, "CONFINE"))
>> +        return XC_DOM_NUMA_CONFINE;
>> +    if (!strcasecmp(str, "SPLIT"))
>> +        return XC_DOM_NUMA_SPLIT;
>> +    if (!strcasecmp(str, "STRIPE"))
>> +        return XC_DOM_NUMA_STRIPE;
>> +
>> +    return XC_DOM_NUMA_NONE;
>
> Shouldn't the function return something like "unknown" here?
> This would allow to detect typos in the config file.
I  was thinking that if someone misconfigures (or for typos), we fall back
to the current case. But, it makes sense not to do that. Will change this.

>
>> @@ -650,6 +686,14 @@ static void parse_config_data(const char
>>     if (!xlu_cfg_get_long (config, "videoram", &l))
>>         b_info->video_memkb = l * 1024;
>>  +    if (!xlu_cfg_get_string (config, "strategy", &buf)) {
>> +        b_info->numa_config.strategy = numa_str_to_val(buf);
>
> Here one chould check the returned value for "unknown" to detect
> illegal strategy types.
OK.

>>
>> +        if (!xlu_cfg_get_long (config, "vnodes", &l))
>> +            b_info->numa_config.nr_nodes = l;
>> +        if (!xlu_cfg_get_long (config, "stripesz", &l))
>> +            b_info->numa_config.stripe_size = l;
>> +    }
>> +
>>     if (!xlu_cfg_get_string (config, "kernel", &buf))
>>         b_info->kernel.path = strdup(buf);
>>
>
> Regards,
> Andre.
>
> --
> Andre Przywara
> AMD-Operating System Research Center (OSRC), Dresden, Germany
> Tel: +49 351 448-3567-12
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel