View Issue Details

IDProjectCategoryView StatusLast Update
0003004Kali LinuxKali Package Improvementpublic2016-02-23 16:26
Reportercarlopmart Assigned Torhertzog  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0 
Fixed in Version2016.1 
Summary0003004: Enable memory cgroup support in linux-image-adm64
Description

Hi all,

It could be possible to enable memory cgroup in default kernel for kali Sana 2.0?

Actually it seems disabled:

CONFIG_CGROUPS=y

CONFIG_CGROUP_DEBUG is not set

CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_DISABLED=y
CONFIG_MEMCG_SWAP=y

Activities

rhertzog

rhertzog

2016-01-22 08:06

administrator   ~0004532

The memory cgroup is available but disabled, it's up to you to enable it. Add "cgroup_enable=memory" to your kernel command line when you boot. You can modify GRUB_CMDLINE_LINUX in /etc/default/grub for example and run update-grub.

A quick search on the web would have told you so.

carlopmart

carlopmart

2016-01-22 10:18

reporter   ~0004578

Thanks Raphael,

I've done it before to open this bug.

In my /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory quiet"

dmesg output:

[ 0.000000] CPU0 microcode updated early to revision 0x1c, date = 2014-07-03
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.0.0-kali1-amd64 ([email protected]) (gcc version 4.9.2 (Debian 4.9.2-10) ) 0000001 SMP Debian 4.0.4-1+kali2 (2015-06-03)
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.0.0-kali1-amd64 root=/dev/mapper/sysvol-rootvol ro cgroup_enable=memory quiet
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009d3ff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009d400-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved

but lxc-checkconfig returns:

Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.0.0-kali1-amd64
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: missing
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

And running a lxc from libvirtd, returns the following errors:

2016-01-21 15:30:33.792+0000: 19020: error : virCgroupGetValueStr:758 : Unable to read from '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.me
msw.limit_in_bytes': No such file or directory
2016-01-21 15:30:33.801+0000: 19020: error : virFileReadAll:1289 : Failed to open file '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.memsw.l
imit_in_bytes': No such file or directory
2016-01-21 15:30:33.801+0000: 19020: error : virCgroupGetValueStr:758 : Unable to read from '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.me
msw.limit_in_bytes': No such file or directory
2016-01-21 15:30:33.809+0000: 19020: error : virFileReadAll:1289 : Failed to open file '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.memsw.l
imit_in_bytes': No such file or directory
2016-01-21 15:30:33.809+0000: 19020: error : virCgroupGetValueStr:758 : Unable to read from '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.me
msw.limit_in_bytes': No such file or directory
2016-01-21 15:30:33.832+0000: 19020: error : virFileReadAll:1289 : Failed to open file '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.memsw.l
imit_in_bytes': No such file or directory
2016-01-21 15:30:33.832+0000: 19020: error : virCgroupGetValueStr:758 : Unable to read from '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.me
msw.limit_in_bytes': No such file or directory
2016-01-21 15:30:33.836+0000: 19020: error : virFileReadAll:1289 : Failed to open file '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.memsw.l
imit_in_bytes': No such file or directory
2016-01-21 15:30:33.836+0000: 19020: error : virCgroupGetValueStr:758 : Unable to read from '/sys/fs/cgroup/memory/machine.slice/machine-lxc\x2dcos6gasrv.scope/memory.me
msw.limit_in_bytes': No such file or directory

rhertzog

rhertzog

2016-02-18 13:44

administrator   ~0004718

I see linux 4.0 and this was with Kali Sana.

Can you try to upgrade to Kali Rolling 2016.1 and tell me if you still have the problem?

Because AFAIK, systemd does mount all the cgroup filesystems automatically.

carlopmart

carlopmart

2016-02-23 15:18

reporter   ~0004753

Ok, using 2016.1 release, it works:

Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.3.0-kali1-amd64
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

Many thanks Raphael.

rhertzog

rhertzog

2016-02-23 16:26

administrator   ~0004754

Thanks, closing the ticket.

Issue History

Date Modified Username Field Change
2016-01-21 14:59 carlopmart New Issue
2016-01-22 08:06 rhertzog Note Added: 0004532
2016-01-22 08:06 rhertzog Status new => closed
2016-01-22 08:06 rhertzog Assigned To => rhertzog
2016-01-22 08:06 rhertzog Resolution open => fixed
2016-01-22 10:18 carlopmart Note Added: 0004578
2016-01-22 10:18 carlopmart Status closed => feedback
2016-01-22 10:18 carlopmart Resolution fixed => reopened
2016-02-18 13:44 rhertzog Note Added: 0004718
2016-02-23 15:18 carlopmart Note Added: 0004753
2016-02-23 15:18 carlopmart Status feedback => assigned
2016-02-23 16:26 rhertzog Note Added: 0004754
2016-02-23 16:26 rhertzog Status assigned => resolved
2016-02-23 16:26 rhertzog Fixed in Version => 2016.1
2016-02-23 16:26 rhertzog Resolution reopened => fixed