Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp561359rdb; Thu, 30 Nov 2023 11:49:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+WFv6sZIk6FvnzO2tFeqqjmmuZPKftyxputj8nO5J6PAX9andht9nL78y+M2p1ON7Q19N X-Received: by 2002:a17:902:bf09:b0:1cf:fca9:80b3 with SMTP id bi9-20020a170902bf0900b001cffca980b3mr8393581plb.33.1701373769061; Thu, 30 Nov 2023 11:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701373769; cv=none; d=google.com; s=arc-20160816; b=Xf8+IpLDJ3Z/liq+uduCe1NRYta/HMW/pFfT1bB480mqiKaH3+Kt/py5qtvu+DYGju 9vY6sPy+Knpq1EunvqYgpHP2DbvCCsPGaGNLzB+zlK8KSIj21L5nnX/KMuVKXJsrgBuJ yQcQOsEXC1mFKQGZjdzV4QPifn28g87dPtSjlZMrwMdg1SwKIt82P1TreLQxPfnvEMJo u6X44/ddCltMKZW2KBj/RVfsKUf8CNGPwdyN6F1NW9RhFFVlh9ls3/VXhxYLQnc1UZok liS9ham9GlpexU2JhzFGJyZLhCWekE0k87B2xiB5BQPGSnAMWoQSMd/spplBj9ZJGNhJ GP5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MBPZtr1NEPnHIJYCcwUX8aLQYfzJui4bNFBqHRT6Zjk=; fh=qst2HyG93tE+u7u48Bw2YCTPebekNoRQL9T+hzJLCUA=; b=saeKPpacsGJUBLBF+wQc3oVcKebBufI2c2hXKh0gKzj6t5bb8rlTvJgfilBtShCvE/ PNCgw4zGxEFtRb2a1x9c8TjFxXfLQzFGG5nt90wJ7+xWeIypFPeFgECQyfpcuSGHBmmI PuRqAOEJZukRdH1zjuvGhjPfrE6/mhbFaQcLSBcekuj1UFpciR+rTI8r1HgtUZoqdych z4NX8vge5ueA13QhxGvlMpkjb2OPmxGXhn2IPo8RRNCzH70Pkk1OkfftBdl4QYTv+Q/7 gZHhUBtEi9DtPPwd15CtMJ0qOBe+vxPzHTtFL9rz7YxSWFMcXzNDnDLEy81bHe9At0YX W33w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=YkAKUESV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b3-20020a170903228300b001cfb1e21bcdsi1887913plh.539.2023.11.30.11.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:49:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=YkAKUESV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 025438026911; Thu, 30 Nov 2023 11:49:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376487AbjK3TtK (ORCPT + 99 others); Thu, 30 Nov 2023 14:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjK3TtJ (ORCPT ); Thu, 30 Nov 2023 14:49:09 -0500 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6242010DB for ; Thu, 30 Nov 2023 11:49:15 -0800 (PST) Received: by mail-ua1-x92e.google.com with SMTP id a1e0cc1a2514c-7c4adc5dcdaso439143241.2 for ; Thu, 30 Nov 2023 11:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1701373754; x=1701978554; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MBPZtr1NEPnHIJYCcwUX8aLQYfzJui4bNFBqHRT6Zjk=; b=YkAKUESVkNc26kr7QdIdvPAKnFNJ3SPyiPDRiZk4hgr51op7mzDTwvWGo5UAveOw6R uIu7rfpO0I3bh59FHpl5ljTo5uD5I0jbzjAbXgw/KmB9zbQVh1EPEWYeigUgslRyeBko RTZTwTqQr6CIYVE+QmUCGIqmC1TZbokWYQ58hNThoD2iGGzO6ZSPAJxAyumQrjOuji5+ xwCjSfvaEk6nZHge31c5mipMDGq3ae31c0vniF4DSRID/6A66EiczWs0nX8GiKPiAN6R i0NyDf6eu8rJClXdntnijP+478T7YK2ICxSDuZAPKkCWAfxsNmGpXZuUrbUWCwfKL1EA pUqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701373754; x=1701978554; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MBPZtr1NEPnHIJYCcwUX8aLQYfzJui4bNFBqHRT6Zjk=; b=tCCra00M3vXXOmDEVvpcOBGIHNVJ8Kbzguh8oFIKWOUcfO9GVxkAAL1HPLFWaRVEJk 6ARDxsVDKXoWKPZdvurP64//eqdLuET7LkXlwC2DTjsSBjeEkYG+hJCeUfeeqaFVsDfO YCMekg7XKM6FiDt172hF2DPnb5g9ii+ewDPTy27rDwCbxOHpfwx+v751j7VDKz6RuUpF 5uhBRuDV1syVMwIjp0IPlBqPoVxA6M+NjLfTKN4TwZctC8FiJhw8Go1m3fHVsvKE+txy e5Q7rNmctjdsbkuCTLspWJuop6QJPuIGtZBWoEM58aCqBkRROGM8DC55goOvPaeEYucB mB6g== X-Gm-Message-State: AOJu0YwjA0Am6Mtv2pSmN1x3QQ9MPkR9WDZPdWet2mTdMCTznG/rGMWu w1Z+DJQmNg4OyPLVuIg9hwcNEA== X-Received: by 2002:a67:f10e:0:b0:464:56ed:bfc4 with SMTP id n14-20020a67f10e000000b0046456edbfc4mr3649700vsk.31.1701373754497; Thu, 30 Nov 2023 11:49:14 -0800 (PST) Received: from localhost (2603-7000-0c01-2716-da5e-d3ff-fee7-26e7.res6.spectrum.com. [2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id k8-20020a0cf588000000b0067a57125f21sm783757qvm.52.2023.11.30.11.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:49:13 -0800 (PST) Date: Thu, 30 Nov 2023 14:49:12 -0500 From: Johannes Weiner To: Shakeel Butt Cc: Dan Schatzberg , Roman Gushchin , Yosry Ahmed , Huan Yang , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Muchun Song , Andrew Morton , David Hildenbrand , Matthew Wilcox , Huang Ying , Kefeng Wang , Peter Xu , "Vishal Moola (Oracle)" , Yue Zhao , Hugh Dickins Subject: Re: [PATCH 0/1] Add swappiness argument to memory.reclaim Message-ID: <20231130194912.GB543908@cmpxchg.org> References: <20231130153658.527556-1-schatzberg.dan@gmail.com> <20231130184424.7sbez2ukaylerhy6@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130184424.7sbez2ukaylerhy6@google.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:49:26 -0800 (PST) On Thu, Nov 30, 2023 at 06:44:24PM +0000, Shakeel Butt wrote: > On Thu, Nov 30, 2023 at 07:36:53AM -0800, Dan Schatzberg wrote: > > (Sorry for the resend - forgot to cc the mailing lists) > > > > This patch proposes augmenting the memory.reclaim interface with a > > swappiness= argument that overrides the swappiness value for that instance > > of proactive reclaim. > > > > Userspace proactive reclaimers use the memory.reclaim interface to trigger > > reclaim. The memory.reclaim interface does not allow for any way to effect the > > balance of file vs anon during proactive reclaim. The only approach is to adjust > > the vm.swappiness setting. However, there are a few reasons we look to control > > the balance of file vs anon during proactive reclaim, separately from reactive > > reclaim: > > > > * Swapout should be limited to manage SSD write endurance. In near-OOM > > Is this about swapout to SSD only? > > > situations we are fine with lots of swap-out to avoid OOMs. As these are > > typically rare events, they have relatively little impact on write endurance. > > However, proactive reclaim runs continuously and so its impact on SSD write > > endurance is more significant. Therefore it is desireable to control swap-out > > for proactive reclaim separately from reactive reclaim > > This is understandable but swapout to zswap should be fine, right? > (Sorry I am not following the discussion on zswap patches from Nhat. Is > the answer there?) Memory compression alone would be fine, yes. However, we don't use zswap in all cgroups. Lower priority things are forced directly to disk. Some workloads compress poorly and also go directly to disk for better memory efficiency. On such cgroups, it's important for proactive reclaim to manage swap rates to avoid burning out the flash. Note that zswap also does SSD writes during writeback. I know this doesn't apply to Google because of the ghost files, but we have SSD swapfiles behind zswap. And this part will become more relevant with Nhat's enhanced writeback patches.