Linux-Doc Archive on lore.kernel.org
 help / color / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Ivan Teterevkov <ivan.teterevkov@nutanix.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mchehab+samsung@kernel.org" <mchehab+samsung@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"jpoimboe@redhat.com" <jpoimboe@redhat.com>,
	"pawan.kumar.gupta@linux.intel.com" 
	<pawan.kumar.gupta@linux.intel.com>,
	"jgross@suse.com" <jgross@suse.com>,
	"oneukum@suse.com" <oneukum@suse.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/vmscan: add vm_swappiness configuration knobs
Date: Thu, 12 Mar 2020 10:25:31 +0100
Message-ID: <20200312092531.GU23944@dhcp22.suse.cz> (raw)
In-Reply-To: <BL0PR02MB560167492CA4094C91589930E9FC0@BL0PR02MB5601.namprd02.prod.outlook.com>

On Wed 11-03-20 17:45:58, Ivan Teterevkov wrote:
> This patch adds a couple of knobs:
> 
> - The configuration option (CONFIG_VM_SWAPPINESS).
> - The command line parameter (vm_swappiness).
> 
> The default value is preserved, but now defined by CONFIG_VM_SWAPPINESS.
> 
> Historically, the default swappiness is set to the well-known value 60,
> and this works well for the majority of cases. The vm_swappiness is also
> exposed as the kernel parameter that can be changed at runtime too, e.g.
> with sysctl.
> 
> This approach might not suit well some configurations, e.g. systemd-based
> distros, where systemd is put in charge of the cgroup controllers,
> including the memory one. In such cases, the default swappiness 60
> is copied across the cgroup subtrees early at startup, when systemd
> is arranging the slices for its services, before the sysctl.conf
> or tmpfiles.d/*.conf changes are applied.
> 
> One could run a script to traverse the cgroup trees later and set the
> desired memory.swappiness individually in each occurrence when the runtime
> is set up, but this would require some amount of work to implement
> properly. Instead, why not set the default swappiness as early as possible?

I have to say I am not a great fan of more tunning for swappiness as
this is quite a poor tunning for many years already. It essentially does
nothing in many cases because the reclaim process ignores to value in
many cases (have a look a get_scan_count. I have seen quite some
reports that setting a specific value for vmswappiness didn't make any
change. The knob itself has a terrible semantic to begin with because
there is no way to express I really prefer to swap rather than page
cache reclaim.

This all makes me think that swappiness is a historical mistake that we
should rather make obsolete than promote even further.
-- 
Michal Hocko
SUSE Labs

  parent reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 17:45 Ivan Teterevkov
2020-03-11 19:31 ` David Rientjes
2020-03-12 12:48   ` Ivan Teterevkov
2020-03-12 13:36     ` Matthew Wilcox
2020-03-12 14:03       ` Chris Down
2020-03-13 10:49         ` Ivan Teterevkov
2020-03-13 21:50           ` David Rientjes
2020-03-16 16:03             ` Ivan Teterevkov
2020-03-12  9:25 ` Michal Hocko [this message]
2020-03-12 12:54   ` Ivan Teterevkov
2020-03-12 13:26     ` Michal Hocko
2020-03-16 14:53       ` Vlastimil Babka
2020-03-16 16:14         ` Ivan Teterevkov
2020-03-17  8:29         ` Michal Hocko
2020-03-17 14:51           ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312092531.GU23944@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=ivan.teterevkov@nutanix.com \
    --cc=jgross@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=oneukum@suse.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Doc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-doc/0 linux-doc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-doc linux-doc/ https://lore.kernel.org/linux-doc \
		linux-doc@vger.kernel.org
	public-inbox-index linux-doc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-doc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git