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.
Description of problem:
Some values to the --memory option result in an exact match to the cgroup value, others are slightly off. If expected, then this could be fixed with a documentation update.
Version-Release number of selected component (if applicable):
docker-0.11.1-10.el7.x86_64
How reproducible:
very
Steps to Reproduce:
docker run -d -t -m 524889 some_image bash
...
cat /sys/fs/cgroup/memory/system.slice/.../memory.limit_in_bytes
5246976
Same result for --memory 524889 value suffixes of:
b and B => cgroup: 5246976
k and K => cgroup: 5368721408
Suffixes for 'm' and 'g' seem to correctly represent specified value.
Actual results:
Values specified on command line sometimes don't match value in cgroup file
Expected results:
Values from command line should match value in cgroup file, a message should
be printed or logged if the value is altered, and/or value manipulation/conformity rules should be documented for the --memory option.
I think I caught this, the memory size must be a multiper of 4096.
I tested below:
set memory limits crgoup memory limits
================= ========================
1024m 1073741824
1g 1073741824
1048576k 1073741824
1073741824 1073741824
1048576 1048576
1024575 1048576
1048577 1052672 (1048576 + 4096)
1052673 1056768 (1052672 + 4096)
================= ========================
so this should be not a bug.
for the example in the bug, 524889 is between 524288 ~ 528384, so the value in cgroups should be the later.
#docker run -d -t -m 524889 some_image bash
# cat docker-dd95e808b318c29f3f79266118768d4cd196f3a9f2eea88bc8d473a71b58b27d.scope/memory.limit_in_bytes
528384
>>>528384 - 524288 (1024*4*(524889 / 4096)
4096
Great, thanks for confirming. Moving this to 'low' severity then since it'll just be a short documentation/man page update then. I'd suggest something like:
The value may be rounded up to the next multiple of the host's memory page size(?) (typically 4k) unless an exact multiple is given.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1266.html