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 1121583 - non-root user can use memtune to set limits but it can't work
Summary: non-root user can use memtune to set limits but it can't work
Keywords:
Status: CLOSED DUPLICATE of bug 1023366
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.0
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-21 09:35 UTC by Luyao Huang
Modified: 2014-07-28 13:34 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-28 13:34:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Luyao Huang 2014-07-21 09:35:30 UTC
description of problem:
non-root user can use memtune to set limits but it can't work.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7_0.1.x86_64


How reproducible:
100%

Steps to Reproduce:
1.$ virsh uri
qemu:///session

2.$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     sdsd                           shut off

3.$ virsh memtune sdsd
hard_limit     : unlimited
soft_limit     : unlimited
swap_hard_limit: unlimited

4.$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000

5.$ virsh memtune sdsd
hard_limit     : 1024000
soft_limit     : 1024000
swap_hard_limit: 1024000

6.check in xml
$ virsh dumpxml sdsd
 <memtune>
    <hard_limit unit='KiB'>1024000</hard_limit>
    <soft_limit unit='KiB'>1024000</soft_limit>
    <swap_hard_limit unit='KiB'>1024000</swap_hard_limit>
  </memtune>

7.$ virsh start sdsd
Domain sdsd started

8.$ virsh memtune sdsd
error: Unable to get number of memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

9.make sure there is no guest dir in cgroup

/sys/fs/cgroup/memory/machine.slice/

10.$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000 --live
error: Unable to change memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000
error: Unable to change memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000 --config


Actual results:
memtune can't work in non-root user although it can set hard-limit soft-limit swap-hard-limit in xml,
the output limit numerical value is not from cgroup and libvirt can't change cgroup in non-root user.


Expected results:
memtune can't be used in non-root and report error message should be:memtune can't use in user mode/session mode

Additional info:

Comment 2 Ján Tomko 2014-07-28 13:34:50 UTC

*** This bug has been marked as a duplicate of bug 1023366 ***


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