lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2003131447220.242651@chino.kir.corp.google.com>
Date:   Fri, 13 Mar 2020 14:50:01 -0700 (PDT)
From:   David Rientjes <rientjes@...gle.com>
To:     Ivan Teterevkov <ivan.teterevkov@...anix.com>
cc:     Chris Down <chris@...isdown.name>,
        Matthew Wilcox <willy@...radead.org>,
        "corbet@....net" <corbet@....net>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "pawan.kumar.gupta@...ux.intel.com" 
        <pawan.kumar.gupta@...ux.intel.com>,
        "jgross@...e.com" <jgross@...e.com>,
        "oneukum@...e.com" <oneukum@...e.com>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: RE: [PATCH] mm/vmscan: add vm_swappiness configuration knobs

On Fri, 13 Mar 2020, Ivan Teterevkov wrote:

> The above approach doesn't work for me in el7 with systemd 219 or ubuntu 19
> with systemd 242 because presumably the systemd-tmpfiles services start too
> late. Please find the snippet at the bottom of the email.
> 
> The only approach that seems to work is to set up a service to run:
> 
> $ find /sys/fs/cgroup/memory/ -name memory.swappiness | while read -r name; do echo 0 > "${name}"; done
> 
> I think this is quite ugly because there might be a race condition with
> the systemd that could be creating the slices while the find is running.
> One could suggest constraining the depth and going from top to the
> bottom of the memcg but this still looks inherently unstable.
> 

I'll renew my suggestion of defaulting memcg->swappiness to -1 and then 
letting mem_cgroup_swappiness() return vm_swappiness when 
memcg->swappiness == -1.

I don't think the act of creating a memcg and not initializing the 
swappiness value implies that the existing value meets your expectation.

> This is why I ended up with the vm_swappiness patch (which I don't
> quite like myself) but this appears to be the only rock solid option
> unless I've missed anything obvious. There is no doubt that cgroup v1
> is due for replacement and vm_swappiness is frightening but they still
> have certain advantages to employ until they are history.
> 
> $ systemctl --version
> systemd 242 (242)
> +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
> 
> $ cat /etc/lsb-release
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=19.10
> DISTRIB_CODENAME=eoan
> DISTRIB_DESCRIPTION="Ubuntu 19.10"
> 
> $ uname -a
> Linux ubuntu 5.6.0-rc5-custom #1 SMP Wed Mar 11 14:59:15 GMT 2020 x86_64 x86_64 x86_64 GNU/Linux
> 
> $ tail -1 /etc/sysctl.conf
> vm.swappiness=10
> 
> $ cat /etc/tmpfiles.d/10-swap.conf
> w /sys/fs/cgroup/memory/system.slice/memory.swappiness - - - - 20
> w /sys/fs/cgroup/memory/user.slice/memory.swappiness   - - - - 30
> 
> $ find /sys/fs/cgroup/memory -name memory.swappiness | while read -r name; do cat "${name}"; done | sort | uniq -c
>       1 10
>      32 20
>       6 30
>      21 60
> 
> $ find /sys/fs/cgroup/memory -name memory.swappiness | while read -r name; do echo "${name}"; cat "${name}"; done | grep --before-context=1 60
> /sys/fs/cgroup/memory/system.slice/systemd-udevd.service/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/sys-fs-fuse-connections.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2d3\x2d28\x2d1804-116.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2dlogs-81.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/sys-kernel-config.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-core-7917.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/sys-kernel-debug.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2dcharacters-399.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/swapfile.swap/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gtk\x2dcommon\x2dthemes-1440.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2dcharacters-317.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/systemd-journald.service/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/dev-mqueue.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gtk\x2dcommon\x2dthemes-1353.mount/memory.swappiness
> 60
> /sys/fs/cgroup/memory/system.slice/snap-core-8689.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2d3\x2d28\x2d1804-71.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-core18-1668.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2dcalculator-501.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/dev-hugepages.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-gnome\x2dcalculator-544.mount/memory.swappiness
> 60
> --
> /sys/fs/cgroup/memory/system.slice/snap-core18-1223.mount/memory.swappiness
> 60
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ