Re: [systemd-devel] MemoryCurrent property of the root slice is off

2018-10-29 Thread Lennart Poettering
On Mo, 29.10.18 13:54, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote:

> Hey,
> 
> How come the root slice's memory accounting is not matching (or close
> to) with what I see in the /sys/fs? Do we do some other special
> accounting?
> 
> systemctl 239 (default-hierarchy=hybrid)
> 
> a@b:memory$ pwd
> /sys/fs/cgroup/memory
> 
> a@b:memory$ systemctl show -p MemoryCurrent -- -.slice
> MemoryCurrent=6363947008
> a@b:memory$ cat memory.usage_in_bytes
> 5459550208
> 
> a@b:memory$ systemctl show -p MemoryCurrent system.slice
> MemoryCurrent=1540538368
> a@b:memory$ cat system.slice/memory.usage_in_bytes
> 1508548608

In current systemd we'll use the memory accounting exported in
/proc/meminfo for the root cgroup. That's because on cgroupsv2 memory
is not accounted in the root cgroup at all anymore, because the kernel
devs didn't want multiple "sources of truth" anymore. In order to
ensure behaviour is somewhat systematic we'll use that data on
cgroupsv1 too...

The difference in the accounting is probably because one accounts the
kernel itself while the other does not.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] MemoryCurrent property of the root slice is off

2018-10-29 Thread Umut Tezduyar Lindskog
Hey,

How come the root slice's memory accounting is not matching (or close
to) with what I see in the /sys/fs? Do we do some other special
accounting?

systemctl 239 (default-hierarchy=hybrid)

a@b:memory$ pwd
/sys/fs/cgroup/memory

a@b:memory$ systemctl show -p MemoryCurrent -- -.slice
MemoryCurrent=6363947008
a@b:memory$ cat memory.usage_in_bytes
5459550208

a@b:memory$ systemctl show -p MemoryCurrent system.slice
MemoryCurrent=1540538368
a@b:memory$ cat system.slice/memory.usage_in_bytes
1508548608
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel