Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp313435ybh; Thu, 12 Mar 2020 02:27:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtDH+8o1zSc4I8DqdKPaReX+twx7n4Nql3LwZqiYNUjv/Nk1tlB1c/rjcS3vsexzRREzjpj X-Received: by 2002:a05:6830:4a6:: with SMTP id l6mr5868002otd.61.1584005269941; Thu, 12 Mar 2020 02:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584005269; cv=none; d=google.com; s=arc-20160816; b=kfCUBm1VUJS2B7pMjth8XQ/HEVDGAfZiKw93cBxcyWkonTK8WHV/r2IdSqV1J6xCVr SZNjauX1oKlu/xsgADRarSO9j3AtMgyNWPlacf7p+oNzafrtkWkuCAzjZaioTHyzDEFl ECuveAOa7uEjyX0JXzm6ESLf5BbhgseddyQi87rZE8CFN7/Gv6jvaPd7hrWjDSJ+EVXy r3v/DhLBO5kdAPQ8oH5dgHztO8O4mLC9aURlLp1C1ssJpyUjTGRapP3/uZHqaKLtr6wP mszzdr/tLS88U1u7tTQTwZrdRA/zqm4uND2YMmBCZ8JaYe/tkOigrbtxvL3orUoaMIL7 Jg4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cMMKbXhN9eUImpsZTVHPnKioeTIq6eieLdWAKaUpf5Q=; b=NlwrscqWbSDp18kp4Zw6dJz2PI1+fmzHaMZKh1ZAAV28kjkSd3HzmrkFHkldLpMc5a QgI/JEpVaBN782Oh0tOV4gsOoWjVems54FWrUiJyOsmN1CaHnyNiPyga1hFN9PCJcRxN u9xsEAEgXcBQgxwQwW0p+cdeWLlHAS51U6M9a3KJyhnDMit46NOwCxvbyx6W9jHw/1F5 s+hZrg4kkSwoi2tTwvs/+Tb/SgqBPr3Q+xHvGItfxa1RwBBwWc9fkuyML1aw84bZziiV fS4PuN0lbk+M+VBlX4q/LzvAhj9FhtAPDQAiPls7vaJuaFTcQc1qkA3TeyfIwwiv+Ywb tnwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si2539894oia.62.2020.03.12.02.27.36; Thu, 12 Mar 2020 02:27:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbgCLJZj (ORCPT + 99 others); Thu, 12 Mar 2020 05:25:39 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:56176 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbgCLJZh (ORCPT ); Thu, 12 Mar 2020 05:25:37 -0400 Received: by mail-wm1-f65.google.com with SMTP id 6so5227544wmi.5; Thu, 12 Mar 2020 02:25:34 -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=cMMKbXhN9eUImpsZTVHPnKioeTIq6eieLdWAKaUpf5Q=; b=rYRyJo4r9Y64yafECUSIfNxEsCCUxWPxAZt4CF94+z2UE5cQy1zxrLKrkq+tmabAjY RQ2ggT5C0E10fN55vZ5uh9yPABCvh3wfPyZCcG0bDnVUTxE3zEvs7RuZpN4p4PTotxTc XXZnhaF/FuP8EUa39UUHU3uoCMsQlj7bwYAFTfP3c+GbaP46rLnDi0TJj9bfp7LZcFG+ a2Hlk4d4851vGTpX/rSSg5dOb3MeDNTmzXkbN5gBIcLnAxgKpxQQBhZ8Mb5UIT3u8UNk dlvizuZ4CkJOhErnpm/awe+PfLm33IM447DC2jb8JL7QcO35tiN9SV2MiZDvZjvVE+hV jPMg== X-Gm-Message-State: ANhLgQ3i4MwPxhogA1hhERqYOvB4144wGQADK2l+pah0wjp8uGsZ14EU aeDBTNusk6R3z5VkFUMQRC+di3NC X-Received: by 2002:a1c:56d5:: with SMTP id k204mr4046198wmb.13.1584005133477; Thu, 12 Mar 2020 02:25:33 -0700 (PDT) Received: from localhost (ip-37-188-253-35.eurotel.cz. [37.188.253.35]) by smtp.gmail.com with ESMTPSA id v10sm3832526wml.44.2020.03.12.02.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 02:25:32 -0700 (PDT) Date: Thu, 12 Mar 2020 10:25:31 +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: <20200312092531.GU23944@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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