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]
Date:   Tue, 17 Mar 2020 09:29:13 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Ivan Teterevkov <ivan.teterevkov@...anix.com>,
        "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 Mon 16-03-20 15:53:21, Vlastimil Babka wrote:
> On 3/12/20 2:26 PM, Michal Hocko wrote:
> > On Thu 12-03-20 12:54:19, Ivan Teterevkov wrote:
> >> 
> >> Absolutely agree, the semantics of the vm_swappiness is perplexing.
> >> Moreover, the same get_scan_count treats vm_swappiness and cgroups
> >> memory.swappiness differently, in particular, 0 disables the memcg swap.
> >> 
> >> Certainly, the patch adds some additional exposure to a parameter that
> >> is not trivial to tackle but it's already getting created with a magic
> >> number which is also confusing. Is there any harm to be done by the patch
> >> considering the already existing sysctl interface to that knob?
> > 
> > Like any other config option/kernel parameter. It is adding the the
> > overall config space size problem and unless this is really needed I
> > would rather not make it worse.
> 
> Setting the vm_swappiness specific case aside, I wonder if if would be
> useful to be able to emulate any sysctl with a kernel parameter,
> i.e. boot the kernel with sysctl.vm.swappiness=X
> There are already some options that provide kernel parameter as well
> as sysctl, why not just support all.

This sounds like a much better idea than a case by case handling. I
wouldn't be surprised if some kernel parameters would duplicate sysctl
values. I cannot judge the implementation unfortunately but from a quick
glance it makes sense to me. Especially where you hooked it into because
not all handlers are simple setters for a global value. Some of them
have a much more complicated logic which requires a lot of
infrastructure to be set up already. So putting do_sysctl_args right
before the init is executed should be good enough.

Care to post an RFC to a larger audience? Let's see where we get from
there.

> Quick and dirty proof of concept:
> @@ -1367,6 +1384,8 @@ static int __ref kernel_init(void *unused)
>  
>  	rcu_end_inkernel_boot();
>  
> +	do_sysctl_args();
> +
>  	if (ramdisk_execute_command) {
>  		ret = run_init_process(ramdisk_execute_command);
>  		if (!ret)
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ