Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp533905ybh; Thu, 12 Mar 2020 06:37:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsHcPyVC52mR6lNbJldu5YooQQsqhfLcwtLzTXtr9f+OyPxzbx9uLfY0QG9Cm2Cq/uPh7Y+ X-Received: by 2002:aca:b703:: with SMTP id h3mr2611830oif.148.1584020254387; Thu, 12 Mar 2020 06:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584020254; cv=none; d=google.com; s=arc-20160816; b=vj2+JNuWONeTDb+K1pa8G32AExe8ZxvPsoUKDSrCIjLtu107+aQuFWNNStuDkU8VcP IQs5aMq4Dtpwfg2AM1HPD1F08yfSaiHZv0dNQMgRyfukXsq55DbvX7S/eWI/CGJIK3v6 1D7nscgkkVlyj71SInDxIT66P67mUN2YWXhuO6wfudboB/qrmKJxRa2p6GbNLshMTbHD UxqwH1N+H93oYX5F/qS42k2Hv0rU42QbvFafSnp8Aa+3ob3VfuLprMelFm5UcZIvqwaF U+72GiV0DgvRBcoLn339kZT5tSXxLXleZ2EPtaLK0YVLnGX2flAkBtI2917/ghaDmLRT 2epA== 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 :dkim-signature; bh=RRgNREQ8UhkO3D0KGQ+TpnJA22cUraRKriEcCp/CNIo=; b=h/dGngadhVduI1kUsHDuxN0YzF9bpydAGEDGiY3VSlc19cAdWqkZwr2dfAOyaHLJJu kIe2kR0hBihaEEtHcfCq7EdByRKauhRRYWtoww70htBinhJXHeBu1n8E77rrQVKddo0G VDJqYltywt3H+d/Fi96/c+hf9b/nBNLkNxmt9x52VsrTpuXbehAQFBytUtnSo2ZGFQ+M HY2DUiPmQaAcYzneDzrwoljqyGtF2YdthOC74G6he8CGnlfz3UfsUx8krJKYDiZCh3Vz Lec0oWEhUh1Zvh7ehAIpAReBkiHdrOrb2SlCib7Zttt1zrI/+g8yKzx+1T1Ixu3GYCUC 2z/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DQrcfUro; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8si2682936oib.260.2020.03.12.06.37.21; Thu, 12 Mar 2020 06:37:34 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DQrcfUro; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbgCLNgn (ORCPT + 99 others); Thu, 12 Mar 2020 09:36:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52566 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbgCLNgn (ORCPT ); Thu, 12 Mar 2020 09:36:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RRgNREQ8UhkO3D0KGQ+TpnJA22cUraRKriEcCp/CNIo=; b=DQrcfUrokLYL079BOwXFqbQ+KH EYbmsxnFf9jbmK5CabXbZeduhE7TipkWRWluji9pHuD1r1knCelnjsKgKPAvwHoOOOoHQ+sDNKeLI riluurvz/NiNicNGeC5hcup9GXjY6zN6FjzehX82+DRve183ox4VCgi3JWfMK68kxekJeBzTkWgYi kAJcH1TpnUuskFbmGH4Ss15fxNFUgbpo/YsmoHJzdLhipfsY2wLUFjklmD3mxhMDEV2Ot9TUdksYB yVg0Juq00nmF2rtacSR2hbLPxrgIOQhbUUWLG+u2dN9P7YTvYahNRu5qU/BwLAN65sZEfT8WDAERY bcYSvJ/g==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCO0q-00011o-8h; Thu, 12 Mar 2020 13:36:36 +0000 Date: Thu, 12 Mar 2020 06:36:36 -0700 From: Matthew Wilcox To: Ivan Teterevkov Cc: David Rientjes , "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: <20200312133636.GJ22433@bombadil.infradead.org> 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 Thu, Mar 12, 2020 at 12:48:22PM +0000, Ivan Teterevkov wrote: > On Wed, 11 Mar 2020, David Rientjes wrote: > > On Wed, 11 Mar 2020, 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. > > > > Seems like something that can be fully handled by an initscript that would > > set the sysctl and then iterate the memcg hierarchy propagating the > > non-default value. I don't think that's too much of an ask if userspace > > wants to manipulate the swappiness value. > > > > This is exactly what I'm trying to avoid: in some distros there is no way > to tackle the configuration early enough, e.g. in systemd-based systems > the systemd is the process that starts first and arranges memcg in a way > it's configured, but unfortunately, it doesn't offer the swappiness knob. This sounds like a systemd problem. Have you talked to the systemd people about fixing it in systemd?