Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8221978rwb; Wed, 23 Nov 2022 17:52:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6UnYdvGxV+kH5/JLehVUOacKICeXT9h6midG6T1kVBkX16PwRV3B1vXYp8XNxLvrOiG6LU X-Received: by 2002:aa7:d0d4:0:b0:461:b1b9:bed0 with SMTP id u20-20020aa7d0d4000000b00461b1b9bed0mr19762978edo.122.1669254779575; Wed, 23 Nov 2022 17:52:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669254779; cv=none; d=google.com; s=arc-20160816; b=CVlCuligwd2mNlq/kSF3nPIMAJPVusoRfqOB2v7SuaMN55CeCpKNQkylORM154DUUE FKOEylUte1HlffYFtDHphrK92M6q5cTCrYrOUQjpPTC5lk+UDbqEtTNnK5bcOQY5lmd6 NAtJFqAs5FjxB7qL0QBZcPdtdRMz+j42A+HMiYAmwdHVWF/9TopkTak/816HXkLVIfIk 7gVMkxvpN7jt6pmz5khZgW7+EaGPxPF08bhhJXhfHlOVdZTVWSkDZdv1tM1TIO1eAFEh +XItCXao6D8HReQGdNV0nnHp0Tz2kOx0jjFNnlMOEJtBJliCDZ4DMTid1NTaCI/XZkRE 8Y4w== 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=1fnmRHuC0+yQgv2N5cDHL0+8S+SApOU5affk2tW+8RI=; b=x5rewyD9na+Xs9Mqiz7Sf5yXZH2cb4pOUcsRDcbcabqorBGqcnUDyQ0Om11R8vf+Lx xZwHYXZLJROxfceL7nSnEU3CZ3DrgZmIYxhi84S3h2hrz0zBdZArT0pQ+HZVfVMHwLCI 7Lq6kmIdXn1G9oyoiq5VYxLhJf+S9EMRyS5qC+MV4p7IwjSXYpwdrjQv9aL8lm8OHgW5 DsNjHbTYeZ6P+crJa/oOW3ZEtkelu22Fm9flScZpRIizr5hoDAxfyOmxJlDwLm0zdZZ4 EVzOtx1aYg2MBc0HLG77KUCB6Nsvt/Be8NsU9yvtUq4s3TYsPRImsHxGt54WzKLArdOT 5cAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Kg9dxVbp; 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 y7-20020a056402440700b0045d3e06e4d5si17092427eda.389.2022.11.23.17.52.38; Wed, 23 Nov 2022 17:52: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=Kg9dxVbp; 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 S229449AbiKXB3n (ORCPT + 88 others); Wed, 23 Nov 2022 20:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbiKXB3k (ORCPT ); Wed, 23 Nov 2022 20:29:40 -0500 Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2341B7CB8A for ; Wed, 23 Nov 2022 17:29:39 -0800 (PST) Received: by mail-ua1-x936.google.com with SMTP id p1so120243uak.11 for ; Wed, 23 Nov 2022 17:29:39 -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=1fnmRHuC0+yQgv2N5cDHL0+8S+SApOU5affk2tW+8RI=; b=Kg9dxVbpFy1QGNmYu5mluAC8FbOjsrd3VGHz1Xw1eB5JmUlXd6/vUX/f7Qs1GsceQe qiq3HKOvJZI8CDuBNcKBINx39Al3fBX1zpv9msgyA3teFqVsAFQxOTTcTqg4uqLbvxZ0 32UGeSBr60jeh2LOtbBGYzq3JagtcNWKe/sjGoknfXZSKKMLgCzLiVv/aJbuXUcFn8lj iqNEq5UM7Aeq7rIkXiEQfuEvM9nI+3PLMOSSu0jAIYd73ZJZ+uQlQy22barLFPkaxvNS Ub33Y1CcHtEvh2PWQ+78FLe/QueLpwlNUklpmhKyMYSNAaUkTJhVQ5iP+Caew6oIihbo gMmQ== 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=1fnmRHuC0+yQgv2N5cDHL0+8S+SApOU5affk2tW+8RI=; b=dRuJ5A24JUwBnzqfeRJXjijy6FVfwTzn3D1kVIjJlQdScvrThreyN77AbxMvPnKHFp c6+gMOmHgHaEjF2+Y+Uu1dM8O+Rqn1VRPL9kbW7evd8RJeqajZfIY70MEQVWgyz4/ngy 3DnOQDHkK3PyE0iGPZO7CxQvKpPx8QDFbw26qWYGBwqRwNvhXZVz1QBYxigLtUGPUZuy 1XQG7PZF9EZnqriMh5/tCWH5rB0eMjvbpvLRXZCTDq77eCPbfnY5qRPPh0ubR3LJu/SG hEsQtaI2+O9MfIrBYDmY2u4KGhD/O12pv5xLqMLfRYiCYbx3gvKOc+NSSP/GrakbjU3f Wz7A== X-Gm-Message-State: ANoB5pliuLtMAZ4CipBG3WOUhTSK7b5/T/CsYzGWI/7Fe+J1YRX1csh1 EyClXZ6o+IWs81x/F0B5VIWu07Z+KBPFzxxytZdzGA== X-Received: by 2002:ab0:77c1:0:b0:418:620e:6794 with SMTP id y1-20020ab077c1000000b00418620e6794mr17490339uar.59.1669253378097; Wed, 23 Nov 2022 17:29:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yu Zhao Date: Wed, 23 Nov 2022 18:29:01 -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=unavailable 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 6:18 PM Yu Zhao wrote: > > 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 This is the baseline kernel, not MGLRU. > $ 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