swap test for cgroups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I had tried to perform the following test according to:
http://lxr.free-electrons.com/source/Documentation/cgroups/memcg_test.txt#L211
mkdir /sys/fs/cgroup/memory/group1

echo $$ > /sys/fs/cgroup/memory/group1/cgroup.procs

echo 40M >  /sys/fs/cgroup/memory/group1/memory.limit_in_bytes

Run a process which is a very short program, allocating 100MB:
int main() {
// Allocate 100 MB
  void *mem = malloc(1024*1024*100);
  if (mem)
      printf("malloc is ok\n");
  pause();
}


VmSize seems a bit larger than 100MB, and this seems ok, when adding
the overhead of running a process:
cat /proc/$$/status | grep VmSize
VmSize:   116920 kB



cat   /sys/fs/cgroup/memory/group1/memory.stat  | grep swap
swap 0
total_swap 0

cat /proc/$$/status | grep  -i swap
VmSwap:        0 kB


I would expect that the swap will be 60M according to the link to the
memcg_test.txt mentioned earlier.

Any ideas ?

Regards,
Kevin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux