Bug 920406 - Can't get exact error when failed to run numatune with specified node
Can't get exact error when failed to run numatune with specified node
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
: 955489 (view as bug list)
Depends On: 857312
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-11 23:10 EDT by Luwen Su
Modified: 2014-06-17 20:45 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 857312
Environment:
Last Closed: 2014-06-13 06:54:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Comment 2 Osier Yang 2013-04-08 12:44:28 EDT
See comment 1.
Comment 3 Luwen Su 2013-04-11 03:53:23 EDT
Rewrite the steps in rhel7's way
libvirt-1.0.4-1.el7.x86_64
qemu-kvm-1.4.0-2.el7.x86_64
kernel-3.9.0-0.rc6.51.el7.x86_64
libcgroup-0.38-3.el7.x86_64

#virsh nodeinfo
CPU model:           x86_64
CPU(s):              12
CPU frequency:       800 MHz
CPU socket(s):       1
Core(s) per socket:  6
Thread(s) per core:  1
NUMA cell(s):        2
Memory size:         32686388 KiB

# virsh start test

# virsh numatune test
numa_mode      : strict
numa_nodeset   : 0

# virsh numatune test --nodeset 0

# virsh numatune test --nodeset 1
error: Unable to change numa parameters
error: unable to set numa tunable: Unknown error -1

# virsh numatune test strict --nodeset 1 --live
error: Unable to change numa parameters
error: unable to set numa tunable: Unknown error -1

# virsh numatune test strict --nodeset 1 --current
error: Unable to change numa parameters
error: unable to set numa tunable: Unknown error -1

# echo 1 > /sys/fs/cgroup/cpuset/libvirt/qemu/test/cpuset.mems 
-bash: echo: write error: Device or resource busy

The libvirtd debuginfo:
libvirtd[4943]: Make group /libvirt/qemu/test
libvirtd[4943]: Make controller /sys/fs/cgroup/cpu,cpuacct/system/libvirtd.service/libvirt/qemu/test/
libvirtd[4943]: Make controller /sys/fs/cgroup/cpu,cpuacct/system/libvirtd.service/libvirt/qemu/test/
libvirtd[4943]: Make controller /sys/fs/cgroup/cpuset/libvirt/qemu/test/
libvirtd[4943]: Make controller /sys/fs/cgroup/memory/libvirt/qemu/test/
libvirtd[4943]: Make controller /sys/fs/cgroup/devices/libvirt/qemu/test/
 libvirtd[4943]: Make controller /sys/fs/cgroup/freezer/libvirt/qemu/test/
libvirtd[4943]: Make controller /sys/fs/cgroup/blkio/libvirt/qemu/test/
libvirtd[4943]: Set value '/sys/fs/cgroup/cpuset/libvirt/qemu/test/cpuset.mems' to '1'
libvirtd[4943]: Closed fd 22
libvirtd[4943]: Failed to write value '1': Device or resource busy
libvirtd[4943]: unable to set numa tunable: Unknown error -1
Comment 4 Osier Yang 2013-04-22 00:43:49 EDT
(In reply to comment #3)
> Rewrite the steps in rhel7's way
> libvirt-1.0.4-1.el7.x86_64
> qemu-kvm-1.4.0-2.el7.x86_64
> kernel-3.9.0-0.rc6.51.el7.x86_64
> libcgroup-0.38-3.el7.x86_64
> 
> #virsh nodeinfo
> CPU model:           x86_64
> CPU(s):              12
> CPU frequency:       800 MHz
> CPU socket(s):       1
> Core(s) per socket:  6
> Thread(s) per core:  1
> NUMA cell(s):        2
> Memory size:         32686388 KiB
> 
> # virsh start test
> 
> # virsh numatune test
> numa_mode      : strict
> numa_nodeset   : 0
> 
> # virsh numatune test --nodeset 0
> 
> # virsh numatune test --nodeset 1
> error: Unable to change numa parameters
> error: unable to set numa tunable: Unknown error -1
> 
> # virsh numatune test strict --nodeset 1 --live
> error: Unable to change numa parameters
> error: unable to set numa tunable: Unknown error -1
> 
> # virsh numatune test strict --nodeset 1 --current
> error: Unable to change numa parameters
> error: unable to set numa tunable: Unknown error -1
> 
> # echo 1 > /sys/fs/cgroup/cpuset/libvirt/qemu/test/cpuset.mems 
> -bash: echo: write error: Device or resource busy
> 
> The libvirtd debuginfo:
> libvirtd[4943]: Make group /libvirt/qemu/test
> libvirtd[4943]: Make controller
> /sys/fs/cgroup/cpu,cpuacct/system/libvirtd.service/libvirt/qemu/test/
> libvirtd[4943]: Make controller
> /sys/fs/cgroup/cpu,cpuacct/system/libvirtd.service/libvirt/qemu/test/
> libvirtd[4943]: Make controller /sys/fs/cgroup/cpuset/libvirt/qemu/test/
> libvirtd[4943]: Make controller /sys/fs/cgroup/memory/libvirt/qemu/test/
> libvirtd[4943]: Make controller /sys/fs/cgroup/devices/libvirt/qemu/test/
>  libvirtd[4943]: Make controller /sys/fs/cgroup/freezer/libvirt/qemu/test/
> libvirtd[4943]: Make controller /sys/fs/cgroup/blkio/libvirt/qemu/test/
> libvirtd[4943]: Set value
> '/sys/fs/cgroup/cpuset/libvirt/qemu/test/cpuset.mems' to '1'
> libvirtd[4943]: Closed fd 22
> libvirtd[4943]: Failed to write value '1': Device or resource busy
> libvirtd[4943]: unable to set numa tunable: Unknown error -1

Can you use lsof or fuser to find out which process(es) is using the /sys/fs/cgroup/cpuset/libvirt/qemu/test/cpuset.mems the file?
Comment 6 Osier Yang 2013-04-22 07:14:54 EDT
(In reply to comment #5)
> ValueStr:335 :
> > > Failed to write value '1': Device or resource busy
> > > 2012-09-14 03:20:29.356+0000: 29132: error :
> > > qemuDomainSetNumaParameters:7549 : unable to set numa tunable: Unknown error
> > > 18446744073709551615
> > 
> > Looks like we should the useful error "Device or resource busy".
> > 
> 
> Fix for this:
> 
> commit a71ec98841c825dfb7e9b648dd85f5140f29d090
> Author: Osier Yang <jyang@redhat.com>
> Date:   Mon Apr 22 19:40:19 2013 +0800
> 
>     qemu: Fix the wrong expression
>     
>     Wrong use of the parentheses causes "rc" always having a boolean value,
>     either "1" or "0", and thus we can't get the detailed error message
>     when it fails:
>     
>     Before (I only have 1 node):
>     % virsh numatune f18 --nodeset 12
>     error: Unable to change numa parameters
>     error: unable to set numa tunable: Unknown error -1
>     
>     After:
>     virsh numatune f18 --nodeset 12
>     error: Unable to change numa parameters
>     error: unable to set numa tunable: Invalid argument

With this fix, we can get the exact error when writing to the cgroup file, such as "Device or resource busy", but for why the error happened, you need to file a kernel bug...  I move this bug to POST, as it's only about getting the exact error from underlying cgroup filesystem.
Comment 7 Luwen Su 2013-04-23 03:16:58 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > ValueStr:335 :
> > > > Failed to write value '1': Device or resource busy
> > > > 2012-09-14 03:20:29.356+0000: 29132: error :
> > > > qemuDomainSetNumaParameters:7549 : unable to set numa tunable: Unknown error
> > > > 18446744073709551615
> > > 
> > > Looks like we should the useful error "Device or resource busy".
> > > 
> > 
> > Fix for this:
> > 
> > commit a71ec98841c825dfb7e9b648dd85f5140f29d090
> > Author: Osier Yang <jyang@redhat.com>
> > Date:   Mon Apr 22 19:40:19 2013 +0800
> > 
> >     qemu: Fix the wrong expression
> >     
> >     Wrong use of the parentheses causes "rc" always having a boolean value,
> >     either "1" or "0", and thus we can't get the detailed error message
> >     when it fails:
> >     
> >     Before (I only have 1 node):
> >     % virsh numatune f18 --nodeset 12
> >     error: Unable to change numa parameters
> >     error: unable to set numa tunable: Unknown error -1
> >     
> >     After:
> >     virsh numatune f18 --nodeset 12
> >     error: Unable to change numa parameters
> >     error: unable to set numa tunable: Invalid argument
> 
> With this fix, we can get the exact error when writing to the cgroup file,
> such as "Device or resource busy", but for why the error happened, you need
> to file a kernel bug...  I move this bug to POST, as it's only about getting
> the exact error from underlying cgroup filesystem.


File a kernel bug

Bug 955489 - Write valid values to cpuset.mems get device busy on mutilple numa nodes machine
Comment 8 Luwen Su 2013-05-23 01:58:11 EDT
With libvirt-1.0.5-2.el7.x86_64 , 

# virsh nodeinfo
CPU model:           x86_64
CPU(s):              12
CPU frequency:       800 MHz
CPU socket(s):       1
Core(s) per socket:  6
Thread(s) per core:  1
NUMA cell(s):        2
Memory size:         32686424 KiB


# virsh numatune test --nodeset 0
error: Unable to change numa parameters
error: unable to set numa tunable: Device or resource busy

# virsh numatune test --nodeset 0-1

# virsh numatune test --nodeset 1
error: Unable to change numa parameters
error: unable to set numa tunable: Device or resource busy

# virsh numatune test --nodeset 99
error: Unable to change numa parameters
error: unable to set numa tunable: Invalid argument


#echo 0 > /sys/fs/cgroup/cpuset/machine/test.libvirt-qemu/cpuset.mems 
-bash: echo: write error: Device or resource busy


Since it's kernel's issue that refer Bug 955489 , I updated the bug with

1.Reanme
2.Will clone a new one with TestOnly flag to track this issue
3.Verify this one
Comment 9 Luwen Su 2013-05-23 02:05:33 EDT
File Bug 966341 - Failed to run numatune with specified node
Comment 12 Larry Woodman 2014-04-21 08:39:13 EDT
*** Bug 955489 has been marked as a duplicate of this bug. ***
Comment 13 Ludek Smid 2014-06-13 06:54:08 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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