Bug 856999 - libvirt should check the range of setting nodeset
libvirt should check the range of setting nodeset
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
: Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-13 06:41 EDT by hongming
Modified: 2014-04-04 17:00 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-04 17:00:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description hongming 2012-09-13 06:41:15 EDT
Description of problem:
libvirt should check the range of setting nodeset with mode='preferred' or ‘interleave ’ when start guest.


Version-Release number of selected component (if applicable):
libvirt-0.10.1-1.el6.x86_64
qemu-kvm-0.12.1.2-2.307.el6.x86_64 

How reproducible:
100% 

Steps to Reproduce:
# virsh nodeinfo
CPU model:           x86_64
CPU(s):              160
CPU frequency:       1064 MHz
CPU socket(s):       1
Core(s) per socket:  10
Thread(s) per core:  2
NUMA cell(s):        8
Memory size:         1058739720 KiB

# virsh edit testnuma1

<domain type='kvm'>
 .......
  <numatune>
    <memory mode='preferred'  nodeset='10'/>
  </numatune>
......
</domain>

Domain testnuma1 XML configuration edited.

# virsh start testnuma1
Domain testnuma1 started

# virsh destroy testnuma1
Domain testnuma1 destroyed

# virsh edit testnuma1
<domain type='kvm'>
.......
  <numatune>
    <memory mode='interleave' nodeset='10-15'/>
  </numatune>
......
</domain>

Domain testnuma1 XML configuration edited.


# virsh start testnuma1
Domain testnuma1 started


  
Actual results:
When mode='preferred' or ‘interleave ’  and  the setting nodeset is out of range ,guest still can be start successfully.


Expected results:
libvirt should check the range of setting nodeset with mode='preferred' or ‘interleave ’ when start guest. 

Additional info:
Comment 2 zhenfeng wang 2012-09-13 07:01:45 EDT
when set the numa mode  strict,there had two places which were not exactly
# virsh nodeinfo
CPU model:           x86_64
CPU(s):              160
CPU frequency:       1064 MHz
CPU socket(s):       1
Core(s) per socket:  10
Thread(s) per core:  2
NUMA cell(s):        8
Memory size:         1058739720 KiB


# virsh edit testnuma1

<domain type='kvm'>
 .......
  <numatune>
    <memory mode='strict'  nodeset='1'/>
  </numatune>
......
</domain>

1 the problem 1
you should pose a RFE for numatune to check setting
node number bigger than the host maximum when domain is unlive, but
not

virsh numatune testnuma1 --nodeset 9
....
virsh numatune testnuma1 --nodeset 1023

2 the problem 2
It  reported a incorrect error when set the numatune number exceed 1023
# virsh numatune testnuma1 --nodeset 1024
> > error: Unable to change numa parameters
> > error: internal error Failed to parse nodeset
Comment 3 Wayne Sun 2012-09-21 06:34:56 EDT
When mode with 'interleave' or 'preferred', start domain with nodeset out of range, we will get the warning msg in /var/log/libvirt/qemu/$domain_name.log

2012-09-21 10:29:14.349+0000: 31901: warning : qemuProcessInitNumaMemoryPolicy:1752 : nodeset is out of range, there is only 1 NUMA nodes on host
set_mempolicy: Invalid argument


IMHO, I think this is enough for this problem, no need to change the warning msg as error and fail the domain start since the domain will working normal without setting to the wrong node.
Comment 5 Osier Yang 2013-04-22 05:42:46 EDT
(In reply to comment #3)
> When mode with 'interleave' or 'preferred', start domain with nodeset out of
> range, we will get the warning msg in /var/log/libvirt/qemu/$domain_name.log
> 
> 2012-09-21 10:29:14.349+0000: 31901: warning :
> qemuProcessInitNumaMemoryPolicy:1752 : nodeset is out of range, there is
> only 1 NUMA nodes on host
> set_mempolicy: Invalid argument

A error is better. Patch posted:

https://www.redhat.com/archives/libvir-list/2013-April/msg01523.html
Comment 6 Osier Yang 2013-04-22 05:49:10 EDT
(In reply to comment #2)
> when set the numa mode  strict,there had two places which were not exactly
> # virsh nodeinfo
> CPU model:           x86_64
> CPU(s):              160
> CPU frequency:       1064 MHz
> CPU socket(s):       1
> Core(s) per socket:  10
> Thread(s) per core:  2
> NUMA cell(s):        8
> Memory size:         1058739720 KiB
> 
> 
> # virsh edit testnuma1
> 
> <domain type='kvm'>
>  .......
>   <numatune>
>     <memory mode='strict'  nodeset='1'/>
>   </numatune>
> ......
> </domain>
> 
> 1 the problem 1
> you should pose a RFE for numatune to check setting
> node number bigger than the host maximum when domain is unlive, but
> not
> 
> virsh numatune testnuma1 --nodeset 9
> ....
> virsh numatune testnuma1 --nodeset 1023

No, we don't want to enforce the checking for inactive domain, system can have
more CPUs/nodes hotplugged.

> 
> 2 the problem 2
> It  reported a incorrect error when set the numatune number exceed 1023
> # virsh numatune testnuma1 --nodeset 1024
> > > error: Unable to change numa parameters
> > > error: internal error Failed to parse nodeset

It's not "incorrect". Just not that clear enough, not that deserved to fix.
Comment 7 Osier Yang 2013-04-24 11:26:53 EDT
commit 148edcce6642c6c510a69189de0f7c7936035585
Author: Osier Yang <jyang@redhat.com>
Date:   Mon Apr 22 15:14:56 2013 +0800

    util: Error out if the numa nodeset is out of range
    
    Instead of a silent warning, it's better to error out if the
    numa nodeset is out of range. Just like for numa node larger
    than NUMA_NUM_NODES.
Comment 8 Jiri Denemark 2013-06-11 05:56:03 EDT
We decided not to rebase libvirt in RHEL 6.5 to avoid stability issues
we faced in 6.4. This bug has already been fixed upstream but it is
considered unsuitable for backporting to RHEL 6.5 because at least one
of the following conditions is met:

- this bug requires new API(s), which we cannot introduce without
  rebasing libvirt
- the patches required to address this bug are complex or invasive
  causing the backport to be too risky
- this bug is not important enough to justify backporting non-trivial
  patches for it

Thus I'm pushing this bug to RHEL 6.6 (and setting Upstream keyword to
indicate we have patches upstream) for now. If you don't agree with
this resolution, please, give us reasons which you think are strong
enough for us to reevaluate the decision not to backport patches for
this bug.
Comment 12 RHEL Product and Program Management 2014-04-04 17:00:27 EDT
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.