Bug 612646 - setting a low memory.limit_in_bytes in a cgroup produces cpu soft lockups
Summary: setting a low memory.limit_in_bytes in a cgroup produces cpu soft lockups
Status: CLOSED DUPLICATE of bug 608996
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
(Show other bugs)
Version: 6.0
Hardware: All Linux
Target Milestone: rc
: ---
Assignee: Red Hat Kernel Manager
QA Contact: Red Hat Kernel QE team
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-08 17:07 UTC by Casey Dahlin
Modified: 2014-06-18 08:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-09 21:33:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reproducer (1.52 KB, text/plain)
2010-07-08 17:07 UTC, Casey Dahlin
no flags Details

Description Casey Dahlin 2010-07-08 17:07:33 UTC
Created attachment 430425 [details]

Description of problem:
Customer is seeing soft lockups when running the attached reproducer in a cgroup with memory.limit_in_bytes set to a low value (1G is considered low in this case).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
# mkdir /dev/cgroup
# mount -t cgroup -omemory /dev/cgroup
# mkdir /dev/cgroup/test
# cat /proc/self/cgroup
# echo 1G > /dev/cgroup/test/memory.limit_in_bytes
# time sh -c "for i in \$(seq 1 3); do ./malloc 512 4 & done ; wait"

./malloc is the compiled reproducer

Comment 2 Mike Gahagan 2010-07-09 20:02:13 UTC
I think this issue is fixed in the -44 kernel, I could reproduce the hang with -42. There are a couple of issues with the reproducer and it is not going to do what you think it will do (unless you turn off swap)

1.) Mount command needs to be changed to:
mount -t cgroup -omemory none /dev/cgroup

2.) You need to put the shell you are running your test program in the cgroup
echo $$ > /dev/cgroup/test/tasks
the cat command will then return what you expect.

3.) echo 1G > /dev/cgroup/test/memory.limit_in_bytes
This will limit memory usage of your program, but it can still use all the swap it wants, you won't get an oom kill until you either run out of swap or turn off swap altogether.  I was able to get oom-kills with swap turned off and the changes I made to the reproducer outlined above. memory.memsw.limit_in_bytes is probably what you want instead.

Comment 3 Linda Wang 2010-07-09 21:33:49 UTC
closed per comment#2.

Comment 4 Mike Gahagan 2010-07-13 19:17:16 UTC

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

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