From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 760A0C10DCE for ; Thu, 12 Mar 2020 13:26:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E2D0206BE for ; Thu, 12 Mar 2020 13:26:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E2D0206BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C4FDB6B0007; Thu, 12 Mar 2020 09:26:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C012B6B0008; Thu, 12 Mar 2020 09:26:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEED66B000A; Thu, 12 Mar 2020 09:26:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id 95D876B0007 for ; Thu, 12 Mar 2020 09:26:52 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 694934DDA for ; Thu, 12 Mar 2020 13:26:52 +0000 (UTC) X-FDA: 76586785464.19.heat85_5914e1e0e8826 X-HE-Tag: heat85_5914e1e0e8826 X-Filterd-Recvd-Size: 5755 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 13:26:51 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id z15so7474326wrl.1 for ; Thu, 12 Mar 2020 06:26:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4BJbL1v35eEIhi8zAOoH4R9OkyA1Pa/qt0AezIWPz+Y=; b=bO1XEHfxjXh5mdmWICK6F+EXCvYc4JaRppVde+3r/KgRl5+JuFjfKCU39/A19z0Yvd Mb47GNm1EwdOc1YxYZ4Hc+3Q/db4jipjIEJtuPWUjtCDUWlntRmO2eLuj8qBuDfpBHCv tmfLUhbEjBfv4w8GAEDd7AIqLzUayWeBMHHLq8wm4IReEKt1HBpHlk/ibS5AM2Dvsfl+ 74xzF6JUc0/8JZ6BmH/w4UtGk5WrS4mhkwx7f9LMbbajL8+qtNTBx9gW4AApENpALa3Y uGBgPyd1YAx0G+no2ogKskA1uPog5WF7exW2hGoXkg5TvCqSNYqtP2Zb5nO/6bPj65bD lZjg== X-Gm-Message-State: ANhLgQ3r6L+uFnDUGpW0rHb3UrduaBXTfINUcscyOD/28Jmg6m/Pibdl cdxWmnZ/o6Cj6HU1OnEN2I4= X-Google-Smtp-Source: ADFU+vtxeZw7NuCizsLMi/GIiZ/4aK7twtop/K8Ui/bChFfTyUDUr1T43Y8s8B6AZTPRaQRkHyaXGg== X-Received: by 2002:a5d:66cc:: with SMTP id k12mr11905427wrw.157.1584019610763; Thu, 12 Mar 2020 06:26:50 -0700 (PDT) Received: from localhost (ip-37-188-253-35.eurotel.cz. [37.188.253.35]) by smtp.gmail.com with ESMTPSA id w8sm12933799wmm.0.2020.03.12.06.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 06:26:49 -0700 (PDT) Date: Thu, 12 Mar 2020 14:26:42 +0100 From: Michal Hocko To: Ivan Teterevkov Cc: "corbet@lwn.net" , "akpm@linux-foundation.org" , "mchehab+samsung@kernel.org" , "tglx@linutronix.de" , "jpoimboe@redhat.com" , "pawan.kumar.gupta@linux.intel.com" , "jgross@suse.com" , "oneukum@suse.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH] mm/vmscan: add vm_swappiness configuration knobs Message-ID: <20200312132642.GW23944@dhcp22.suse.cz> References: <20200312092531.GU23944@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu 12-03-20 12:54:19, Ivan Teterevkov wrote: > On Thurs, 12 Mar 2020, Michal Hocko wrote: > > > 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. > > 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. -- Michal Hocko SUSE Labs