Memory resource controller oom killing not functioning
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
High
|
Unassigned |
Bug Description
This problem reproduces on Ubuntu 13.10 with a 3.11 kernel but, for comparison, works ok on RHEL 7 with a 3.10 kernel.
Steps to reproduce:
1. Make a directory, for example /home/glyn/cgh1.
2. Switch to root user.
3. Attach the memory resource controller subsystem to a cgroup hierarchy:
# mount -t cgroup -o memory none /home/glyn/cgh1
4. cd /home/glyn/cgh1
5. Createa a child cgroup:
# mkdir example
6. cd example
7. check oom killing is enabled:
# cat memory.oom_control
oom_kill_disable 0
under_oom 0
8. Set a memory limit for the example cgroup of approx. 1 MB:
# echo 1000000 > memory.
# cat memory.
1003520
9. Move the current process into the example cgroup and check it has moved:
# echo $$ > tasks
# cat tasks
7357
8449
# cat tasks
7357
8450
10. Run a process which will exceed 1 MB of memory:
# perl -e 'for ($i = 0; $i < 10; $i++) { $foo .= "A" x (1024 * 1024); }'
#
This terminates successfully whereas it should have been killed. On RHEL 7 (and on earlier Ubuntu versions I have tried), the results look like this:
# perl -e 'for ($i = 0; $i < 10; $i++) { $foo .= "A" x (1024 * 1024); }'
killed
#
I will attempt to reproduce this bug on an upstream kernel, but don't want to lose the bug report during the upgrade, hence I am filing the report now.
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: linux-image (not installed)
ProcVersionSign
Uname: Linux 3.11.0-17-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
Date: Mon Apr 7 10:16:24 2014
HibernationDevice: RESUME=
InstallationDate: Installed on 2014-03-05 (32 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
IwConfig:
eth0 no wireless extensions.
lo no wireless extensions.
docker0 no wireless extensions.
Lsusb:
Bus 001 Device 004: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: innotek GmbH VirtualBox
MarkForUpload: True
ProcEnviron:
LANGUAGE=en_GB:en
TERM=xterm
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageV
linux-
linux-
linux-firmware 1.116.2
RfKill:
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekG
dmi.product.name: VirtualBox
dmi.product.
dmi.sys.vendor: innotek GmbH
Changed in linux (Ubuntu): | |
status: | Confirmed → Invalid |
Note that the above instructions assuming swapping is off, otherwise memory. memsw.limit_ in_bytes would also need to be set to 1000000.
The above testing was done on a 3.11.0-17-generic kernel. Re-testing on an upstream kernel, 3.14.0- 031400- generic ("3.14-trusty"), showed the same problem - the process which should have been killed oom again ran successfully.