Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 920406

Summary: Can't get exact error when failed to run numatune with specified node
Product: Red Hat Enterprise Linux 7 Reporter: Luwen Su <lsu>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, cwei, dallan, dyuan, gsun, honzhang, lsu, mtessun, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 10:54:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 857312    
Bug Blocks:    

Comment 2 Osier Yang 2013-04-08 16:44:28 UTC
See comment 1.

Comment 3 Luwen Su 2013-04-11 07:53:23 UTC
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 04:43:49 UTC
(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 11:14:54 UTC
(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>
> 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 07:16:58 UTC
(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>
> > 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 05:58:11 UTC
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 06:05:33 UTC
File Bug 966341 - Failed to run numatune with specified node

Comment 12 Larry Woodman 2014-04-21 12:39:13 UTC
*** Bug 955489 has been marked as a duplicate of this bug. ***

Comment 13 Ludek Smid 2014-06-13 10:54:08 UTC
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.