Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8209413rwb; Wed, 23 Nov 2022 17:35:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf5StG8twC6Kuw8AJDvDPGkHzjdaOE8EpsboUQBdysUnxoZBts6FDzVyYXa4AIPdFDzRm58b X-Received: by 2002:a17:906:f84a:b0:78d:3cdb:e7ee with SMTP id ks10-20020a170906f84a00b0078d3cdbe7eemr25881101ejb.134.1669253759759; Wed, 23 Nov 2022 17:35:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669253759; cv=none; d=google.com; s=arc-20160816; b=uNd2qlHFl3l/fsxuR6J2OEGeEP4+zJ6yt9GgAUOowTQYypS4RjiWc0Fy18EOByLBdR i+Clb5dmchaBAgd2xL0Wf8l3fg0NG4z3fuVki8GEZljo0Li9nsyFkDpteXCQQ4vAheTs UiWIaKuNL6riQHcoHYCALKLhgKcsuQZGbier6D9UZPL7CAkXbDM9cPpZSU9cZp30SUXg 1gTSUmsOtvANUgdiQOH5rSM9fjZr1A6vCOHViVFM0novu7DVi8KBXqrWmuJwCLkRc4Vr s8qYzFuS7NHyMrHz23orDutrvQe6C0kciqbq9IqUhLlvqACe9HBshh+Hnj8+lGCqp6qa Uahw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7tBUw05aOdjyO9WsFCtTrKc5G8bk3/uCIv/FSXOVjTg=; b=X1XdvSHnXJ1uAWvmW/cYkRmWw+VoeKudWkVWl2U/zx+IfgtRD8AKALX9LWagMOxyoO AC1o4agaL1Q3h1BzXAHgZ1AwxBaatbGtIccshLVY3rx1T4N5kijx7kMyK8im/ND1mMxN 6TX0JtAFAas64pxDGlxccDF0XUrT1FOddUMaCY91LQgmdTF+r4HXqJuNJbVI51sqWFWi D4veapfRDR+17UMkRHL9QVfhfEijNIN38nFAyZqi4XWG4zgamdRlWP2jtE6YgWtzDOsP 2tmx3hRbA05QAWpbZt7PvC2uRPvuZken+G684tU94C4sBG2qYRVfwxUiUjlJz4LRar7M foJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cR5Tx2Oz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a056402441400b004587e99bcc2si13811689eda.383.2022.11.23.17.35.37; Wed, 23 Nov 2022 17:35:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cR5Tx2Oz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiKXBSv (ORCPT + 88 others); Wed, 23 Nov 2022 20:18:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbiKXBSp (ORCPT ); Wed, 23 Nov 2022 20:18:45 -0500 Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A00F61025D3 for ; Wed, 23 Nov 2022 17:18:43 -0800 (PST) Received: by mail-vs1-xe2c.google.com with SMTP id v128so204825vsb.13 for ; Wed, 23 Nov 2022 17:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7tBUw05aOdjyO9WsFCtTrKc5G8bk3/uCIv/FSXOVjTg=; b=cR5Tx2OzMDMnzLuq7r4ycWlRO2gzxpltG7WVxggQ3gkD+H3QiCLqshLPiuVxRJBFSU 0Dsod0ESCG9U1Y2Aqi9PF/Nv0lOtf83kNL85Mf0frsQ6U3JQ76FniUpqF2VAjwvca1/R WUvPfq1mJ0L6Y7QVHxD4+iO9ze85KXFCSaLauEtk3/gSVWHeaP7bEmE8bzDOwW68Pm/7 8kYPeF3UpkDZOn5PVa5upr+5tIqawN9l5Kge+KTEeHp8MWMmzNnu+YgckbCx/b91yURh sdLhWAYMIsjgOSUVC4+ufPavt+Btcq6W8cnHS2pv41s+tlftvvgZPEFPXzgj+qIQTbSC CdTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7tBUw05aOdjyO9WsFCtTrKc5G8bk3/uCIv/FSXOVjTg=; b=y9xnp9uzGjhF0F58fFrgOgFBTdwJunPybsT30byHkhKig0s9Va0ISh1NjD1WjvzKGt CFaM6C7VHghUEQqpMd2unea+T8DsxTIyF6lLEZ/thqjtz3ptFXb5sUbyGtEV6G5mV8qF Ml7nCZ90XR25/dyCRXxn/xecoycVT5FYF6izWz8S/Dgiq7K8ZM5Z3BczTgMoyTE4IJpU pWXQ1YBYDKvbfHABLPHWP5Fde5e+Kb+pKYzB865MqIEgkpT0yveaUt28iTPoVO/WSfsC nvq1kg+bumrlEED0PFYTosAeajPaKbr+Bs4b2wq9XY4u9dSq0R1NtU3ay9iph7yUaPly BbiA== X-Gm-Message-State: ANoB5plIT5L/48qWoKWs8IVJFBTNkmf+f+2ibkI0m3zrUlkrc0xwwBSR 9hDxDq/FQ/mEXAljIuoiYK2RuTzNlcee+MDY0XromQ== X-Received: by 2002:a67:c98e:0:b0:3ad:3d65:22b with SMTP id y14-20020a67c98e000000b003ad3d65022bmr7748848vsk.65.1669252722617; Wed, 23 Nov 2022 17:18:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yu Zhao Date: Wed, 23 Nov 2022 18:18:06 -0700 Message-ID: Subject: Re: Low TCP throughput due to vmpressure with swap enabled To: Johannes Weiner , Ivan Babrou Cc: Linux MM , Linux Kernel Network Developers , linux-kernel , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Eric Dumazet , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Paolo Abeni , cgroups@vger.kernel.org, kernel-team Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 23, 2022 at 2:22 PM Johannes Weiner wrote: > > On Tue, Nov 22, 2022 at 05:44:44PM -0700, Yu Zhao wrote: > > Hi Johannes, > > > > Do you think it makes sense to have the below for both the baseline and > > MGLRU or it's some behavior change that the baseline doesn't want to > > risk? > > It looks good to me. Besides the new FMODE_NOREUSE, it's also a nice > cleanup on the rmap side! > > It would just be good to keep the comment from folio_referenced_one() and > move it to the vma_has_locality() check in invalid_folio_referenced_vma(). > > Otherwise, > > Acked-by: Johannes Weiner Thanks. I've added Ivan's test case to my collection. Interestingly, after this patch, the download speed increased while fio was running (my guess is that fio pushed more cold anon into swap): $ uname Linux test127 6.1.0-rc6-dirty #2 SMP PREEMPT_DYNAMIC Wed Nov 23 16:51:20 MST 2022 x86_64 x86_64 x86_64 GNU/Linux $ go version go version go1.18.1 linux/amd64 $ fio -v fio-3.28 $ curl --version curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13 Release-Date: 2022-01-05 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd fio NOT running: % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 83.6M 0 --:--:-- 0:00:57 --:--:-- 87.0M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 82.8M 0 --:--:-- 0:00:57 --:--:-- 79.1M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 82.7M 0 --:--:-- 0:00:57 --:--:-- 89.7M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 87.4M 0 --:--:-- 0:00:54 --:--:-- 94.3M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 88.1M 0 --:--:-- 0:00:54 --:--:-- 94.7M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 82.6M 0 --:--:-- 0:00:57 --:--:-- 83.9M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 86.4M 0 --:--:-- 0:00:55 --:--:-- 90.1M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 82.8M 0 --:--:-- 0:00:57 --:--:-- 67.5M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 83.4M 0 --:--:-- 0:00:57 --:--:-- 78.7M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 84.0M 0 --:--:-- 0:00:56 --:--:-- 87.4M fio running: % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 86.7M 0 --:--:-- 0:01:11 --:--:-- 88.7M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 87.7M 0 --:--:-- 0:00:54 --:--:-- 93.5M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 88.5M 0 --:--:-- 0:00:53 --:--:-- 95.1M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 91.6M 0 --:--:-- 0:00:52 --:--:-- 94.4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 89.4M 0 --:--:-- 0:00:53 --:--:-- 86.6M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 88.6M 0 --:--:-- 0:00:53 --:--:-- 84.8M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 84.6M 0 --:--:-- 0:00:56 --:--:-- 87.5M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 86.9M 0 --:--:-- 0:00:54 --:--:-- 81.4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 89.0M 0 --:--:-- 0:00:53 --:--:-- 86.4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4768M 0 4768M 0 0 91.1M 0 --:--:-- 0:00:52 --:--:-- 90.6M