[libvirt] [numatune PATCH v2] Support NUMA tuning

Osier Yang jyang at redhat.com
Sun May 15 08:02:14 UTC 2011


于 2011年05月13日 17:42, Daniel P. Berrange 写道:
> On Thu, May 12, 2011 at 11:01:09PM +0800, Osier Yang wrote:
>> 于 2011年05月12日 22:11, Eric Blake 写道:
>>> On 05/12/2011 05:01 AM, Osier Yang wrote:
>>>>>> The new XML is like:
>>>>>>
>>>>>> <numatune>
>>>>>>     <memory model="interleave" nodeset="+0-4,8-12"/>
>>>>>> <numatune>
>>>>>>
>>>>> Compatibility with numactl syntax is an explicit non-goal.
>>>>> numactl is just one platform specific impl.  Compatibility
>>>>> with numactl syntax is of no interest to the ESX or VirtualBox
>>>>> drivers. The libvirt NUMA syntax should be using other
>>>>> existing libvirt XML as the design compatibility target.
>>>>
>>>> Hi, Dan
>>>>
>>>> The syntax is actually not of numactl, but of libnuma, it
>>>> provides API numa_parse_nodestring() to parse the syntax,
>>>
>>> The point we're trying to make is that the XML should _not_ match
>>> libnuma, but should match<vcpu cpuset=...>.  That is, the XML should
>>> use 0-4,^3 to mean 0, 1, 2, 4; and then we need an internal translation
>>> routine that converts ^ to + before calling libnuma functions.
>>
>> "+" means different with "^".
>>
>> [quote]
>> The + indicates that the node  numbers  are relative to the process'
>> set of allowed nodes in its current cpuset.
>> [/quote]
>>
>> Also "!",
>>
>> [quote]
>> A !N-N notation indicates the inverse of N-N,  in other words all
>> nodes except N-N
>> [/quote]
>>
>>>
>>> The fact that we use libnuma under the hood is an implementation detail;
>>> in the future we may find it easier to use some other mechanism to get
>>> the same semantic effect, and that other mechanism may have yet some
>>> third syntax.  Therefore, it is better for libvirt to present consistent
>>> syntax for all of its cpuset parsing, rather than to have two different
>>> cpuset spellings based on what under-the-hood capability it is targetting.
>>>
>>
>> Agree that we may use other mechanism to get the same sementic effect
>> in future, this is good consideration.
>>
>> but the syntax is for NUMA *NODE* set, not *CPU* set, if we use same
>> syntax as cpuset for NUMA nodeset, then we lose some semantics, e.g.
>> for a "!2-4", we could use "^2,^3,^4" as an alternative solution,
>> though it looks quite uncomfortable, and the disadvantage is
>> we abort some smarter syntax, but the advantage is we follow the
>> syntax of cpuset, and actually they are just different at user
>> visible level, the final bitmask are same.
>
> There is no reason why '^2' couldn't also be made to support '^2-4'
> in our current CPU set parsing code.
>
>> But for "+2-4", we have no alternative solution with cpuset's syntax,
>> as far as I could understand, it has specific meaning for NUMA nodeset.
>
> That kind of syntax does not make sense for libvirt. Configuration
> should not be described relative to the current runtime policy. The
> XML description should be self-contained&  canonical format. So I
> consider it a benefit that we don't support that syntax.

Okay, talked with Bill, he's fine with losing of syntax "+", so
my mainly reason to persistent in the syntax is not meaningful
anymore, :-)

Without considering the losing of syntax "+", yes, we need to
confirm with the already existed cpuset syntax. Will update.

Thanks for the patience.

Regards
Osier




More information about the libvir-list mailing list