Thanks, but a strange thing is that lxc performs different from docker. Can you try the following?
# sudo -i # lxc-start -n ubuntu1 # echo 1g > /sys/fs/cgroup/memory/lxc/ubuntu1/memory.limit_in_bytes # echo 1g > /sys/fs/cgroup/memory/lxc/ubuntu1/memory.memsw.limit_in_bytes # lxc-freeze -n ubuntu1 # echo 0 > /sys/fs/cgroup/memory/lxc/ubuntu1/memory.limit_in_bytes # cat /sys/fs/cgroup/memory/lxc/ubuntu1/memory.usage_in_bytes 0 Then, why the last command returns "0" ? Where is kmem? It makes me think that kmem has been drop. Do you know why the whole memory data including kmem is moved to swap, or a bug? -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1568592 Title: bug of "memory.kmem.limit_in_bytes" and "memory.kmem.usage_in_bytes" Status in linux package in Ubuntu: Incomplete Bug description: In ubuntuxenial with linux kernel 4.4, "memory.kmem.limit_in_bytes" cannot be written, and the value of "memory.kmem.usage_in_bytes" is always 0. This issue doesn't happen in ubuntu wily (kernel = 4.2) ProblemType: Bug DistroRelease: Ubuntu 16.04 Package: linux-image-generic 4.4.0.18.19 ProcVersionSignature: Ubuntu 4.4.0-18.34-generic 4.4.6 Uname: Linux 4.4.0-18-generic x86_64 NonfreeKernelModules: zfs zunicode zcommon znvpair zavl AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.4.0-18-generic. ApportVersion: 2.20.1-0ubuntu1 Architecture: amd64 AudioDevicesInUse: USER PID ACCESS COMMAND /dev/snd/controlC0: ghostplant 2724 F.... pulseaudio /dev/snd/controlC1: ghostplant 2724 F.... pulseaudio CurrentDesktop: GNOME-Flashback:Unity Date: Mon Apr 11 03:24:49 2016 JournalErrors: Error: command ['journalctl', '-b', '--priority=warning', '--lines=1000'] failed with exit code 1: Hint: You are currently not seeing messages from other users and the system. Users in the 'systemd-journal' group can see all messages. Pass -q to turn off this notice. No journal files were opened due to insufficient permissions. MachineType: Micro-Star International Co., Ltd. GE60 2PG PciMultimedia: ProcFB: 0 inteldrmfb ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-18-generic root=UUID=9b9acac2-b16b-4328-abc9-407fe4ce4e4d ro quiet swapaccount=1 RelatedPackageVersions: linux-restricted-modules-4.4.0-18-generic N/A linux-backports-modules-4.4.0-18-generic N/A linux-firmware 1.157 SourcePackage: linux UpgradeStatus: No upgrade log present (probably fresh install) WifiSyslog: dmi.bios.date: 12/01/2014 dmi.bios.vendor: American Megatrends Inc. dmi.bios.version: E16GFIMS.626 dmi.board.asset.tag: To be filled by O.E.M. dmi.board.name: MS-16GF dmi.board.vendor: Micro-Star International Co., Ltd. dmi.board.version: REV:0.B dmi.chassis.asset.tag: To Be Filled By O.E.M. dmi.chassis.type: 3 dmi.chassis.vendor: To Be Filled By O.E.M. dmi.chassis.version: To Be Filled By O.E.M. dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrE16GFIMS.626:bd12/01/2014:svnMicro-StarInternationalCo.,Ltd.:pnGE602PG:pvrREV1.0:rvnMicro-StarInternationalCo.,Ltd.:rnMS-16GF:rvrREV0.B:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.: dmi.product.name: GE60 2PG dmi.product.version: REV:1.0 dmi.sys.vendor: Micro-Star International Co., Ltd. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1568592/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp