From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87C69C433E0 for ; Mon, 15 Mar 2021 06:49:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 07798601FD for ; Mon, 15 Mar 2021 06:49:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07798601FD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1C3E26B0006; Mon, 15 Mar 2021 02:49:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14B7B6B006C; Mon, 15 Mar 2021 02:49:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE02E6B0070; Mon, 15 Mar 2021 02:49:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id CE75E6B0006 for ; Mon, 15 Mar 2021 02:49:57 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 87EA22C98 for ; Mon, 15 Mar 2021 06:49:57 +0000 (UTC) X-FDA: 77921183634.04.5D1B817 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by imf01.hostedemail.com (Postfix) with ESMTP id 0D5542000385 for ; Mon, 15 Mar 2021 06:49:56 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id 81so32215184iou.11 for ; Sun, 14 Mar 2021 23:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RXgUmifVTRc4KqwJ1QL+c7x30HxQbXm8rlBa7DWXLDs=; b=mFfGAOHLQ6z6AzIPc5xQAP07QTvg/ukTxuMDCaDFXDsvjg+Af5zW/7P+O8PmMkckf6 Qm83HV/Suz4U6XcHZti3eTpv9hVGtxygGUki4PLJrRbCVztiAEcsfz/GVk6sVOnzAQ4E ER+kVt0InidQr7o4D8U9szlRWXKuKXpRrJPKwOdc7Sa/XjkGzANFht0IRlPdV/kFQOVC cg4s5huqyDpLc4Gu9e/+OYbMakhQjxEuUKPVQrFnSo7hjzlnNMf+UW3SGaACx9pOYPd/ PG8/UgTb/mvkEIPKabbS7moKC9OqhduF6iL153L8D/e4a9Rp2msOHpJzAmt9ONtscejh 4+ZQ== 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=RXgUmifVTRc4KqwJ1QL+c7x30HxQbXm8rlBa7DWXLDs=; b=CxRChcFdu3dHHkAZkTFYumAlJ/yHEUE/foy5DZcitSUlDVF/zLkQmJCdknnQSphHhB sGk7rY2mkWjCH1Mh64X6RZWUPWdrHKTOK7Du8hbYEjh3CfoOXj5K1Pg69Lrq2HovYTLB znBU/16lCud1iBPyUHE4MXjPQbSGVYmynmnfFz7pQdwnwcthOnkNOSunVo2TUGPyu6z6 MpZChqRUiKZ18lA8WcaJOs9jWlDn/kVbzlcS/v/8bJObA/VOsjiCaaznMshq+XzT0XL2 M2ahVtd4zqPtnsm+AFaKnmnNFVbOEhaIGJMUbHB5PAUI8awF4yksRoe+VFDiA73FyvGM I0Nw== X-Gm-Message-State: AOAM533RLd0KxCgz0mGf9xnvAwq9xO2PBXUns46Ur80uMlugQVnCfADb 1iaywJT3odYm91KEkfSdv14AIg== X-Google-Smtp-Source: ABdhPJxkfg7ky75GDgyu6R4kS51RbN2SojXSpPor2VbAGBdjj/Ar8NdNuFjIA/xp7lUi/DhIoAoJ9g== X-Received: by 2002:a05:6638:388e:: with SMTP id b14mr8493434jav.62.1615790996165; Sun, 14 Mar 2021 23:49:56 -0700 (PDT) Received: from google.com ([2620:15c:183:200:4d84:eb70:5c32:32b8]) by smtp.gmail.com with ESMTPSA id b9sm6906580iof.54.2021.03.14.23.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 23:49:55 -0700 (PDT) Date: Mon, 15 Mar 2021 00:49:51 -0600 From: Yu Zhao To: Hillf Danton Cc: Andrew Morton , Johannes Weiner , Mel Gorman , page-reclaim@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 00/14] Multigenerational LRU Message-ID: References: <20210313075747.3781593-1-yuzhao@google.com> <20210315011350.3648-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210315011350.3648-1-hdanton@sina.com> X-Stat-Signature: 43bkjkbjrj7c88ootsfxfso7irxbsegq X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0D5542000385 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=mail-io1-f50.google.com; client-ip=209.85.166.50 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615790996-377702 X-Bogosity: Ham, tests=bogofilter, spamicity=0.001096, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 15, 2021 at 09:13:50AM +0800, Hillf Danton wrote: > On Sat, 13 Mar 2021 00:57:33 -0700 Yu Zhao wrote: > > TLDR > > ==== > > The current page reclaim is too expensive in terms of CPU usage and > > often making poor choices about what to evict. We would like to offer > > a performant, versatile and straightforward augment. > > It makes my day, Monday of thick smog in one of the far east big > cities, to read the fresh work, something like 0b0695f2b34a that removed > heuristics as much as possible, of a coming Mr. Kswapd. Hi Hillf! Sorry to hear about the smog, we don't have smog, only a few feet of snow... I shared the latest version of the cover letter here, if you are a fan of Google Docs: https://docs.google.com/document/d/1UxcpPAFNk1KpTJDKDXWekj_n6ebpQ-cwbXZlYoebTVM And speaking of heuristics, yeah, I totally understand. We've had more than fair share of problems with get_scan_count() and inactive_is_low(). And we are still carrying a workaround (admittedly a terrible one) we posted more that a decade ago, on some of our old kernel versions: https://lore.kernel.org/linux-mm/20101028191523.GA14972@google.com/ And people who run the Chrome browser but don't have this patch (non- Chrome OS) had problems! https://lore.kernel.org/linux-mm/54C77086.7090505@suse.cz/ With generation numbers, the equivalent to inactive_is_low() is max_seq - min(min_seq[!swappiness], min_seq[1]) + 1 > MIN_NR_GENS in get_nr_to_scan(); and the equivalent to get_scan_count() is *file = !swappiness || min_seq[0] > min_seq[1] || (min_seq[0] == min_seq[1] && max(lruvec->evictable.isolated[0], 1UL) * (200 - swappiness) > max(lruvec->evictable.isolated[1], 1UL) * (swappiness - 1)); in isolate_lru_gen_pages(), both in the 10th patch. They work amazingly well for us, and hopefully for you too :)