Explanation for difference between memcg swap accounting and smaps_rollup

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

 



Hi,

I am seeing memory.swap.current usages for the gnome-shell cgroup that
seem high if I compare them to smaps_rollup for the contained
processes. As I don't have an explanation, I thought I would ask here
(shared memory?).

What I am seeing is (see below, after a tail /dev/zero):

memory.swap.current:
  686MiB
"Swap" lines from /proc/$pid/smaps_rollup added up:
  435MiB

We should be moving launched applications out of the shell cgroup
before doing execve(), so I think we can rule out that as a possible
explanation.

I am mostly curious as we currently do swap based kills using systemd-
oomd. So if swap accounting for GNOME Shell is high, then it makes it a
more likely target unfortunately.

Am I missing something obvious?

Benjamin

$ uname -r
5.16.8-200.fc35.x86_64
$ grep -H . org.gnome.Shell@wayland.service/memory.swap.current; for p in $( cat org.gnome.Shell@wayland.service/cgroup.procs ); do ls -l /proc/$p/exe; grep Swap /proc/$p/smaps_rollup; done
org.gnome.Shell@wayland.service/memory.swap.current:712396800
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:00 /proc/2521/exe -> '/usr/bin/gnome-shell (deleted)'
Swap:             294528 kB
SwapPss:          244060 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3853/exe -> /usr/bin/Xwayland
Swap:              55580 kB
SwapPss:           46628 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3884/exe -> /usr/bin/ibus-daemon
Swap:               4104 kB
SwapPss:            4104 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3891/exe -> /usr/libexec/ibus-dconf
Swap:                800 kB
SwapPss:             796 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3892/exe -> /usr/libexec/ibus-extension-gtk3
Swap:              13020 kB
SwapPss:           11864 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3894/exe -> /usr/libexec/ibus-x11
Swap:              16284 kB
SwapPss:           16284 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/3931/exe -> /usr/libexec/ibus-engine-simple
Swap:                312 kB
SwapPss:             312 kB
lrwxrwxrwx. 1 benjamin benjamin 0 Feb 25 16:01 /proc/4086/exe -> /usr/bin/python3.10
Swap:              50640 kB
SwapPss:           49476 kB

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux