Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp543210pxb; Thu, 15 Apr 2021 00:14:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ7lMKT9Pe0Fg+V3B/QN5vwYTxnHAkbfAJ4YuyOzsCQsEd8jpDq1ff+7GvAS9bRh6Rd6F5 X-Received: by 2002:a17:90b:34b:: with SMTP id fh11mr2361113pjb.105.1618470856880; Thu, 15 Apr 2021 00:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618470856; cv=none; d=google.com; s=arc-20160816; b=qdptftF9Kw5A9m/8yavqkOI4Y8X/myoCu5kZadBc45cPaUrktR/KB7RBkKF6BzrsaS GwEVjxD0G1IUQkl+fVpLfHSwkvaO4c1Yq1yHHeOg4tWN8dUKZq2r4WlbcCFaZJ8C17nD c/atJkXvJC/Ec7iMRQBh2Ir5OoXTbGExwvjfFHSGwzc1qBnTtYxdFv1UK3Bm8PL5Vt4y ln9ftM0POBzyyc3rQtbjMsSqB84pyrvteC49EDL3haPUZTo1A9qoaw0x+VkF0v2V+jZ0 NjoD8FXnpyYd5iH5yMBZXfwMsXz+71GcJxyfGkcQdUb4Dq2uASUb/JKCr/D7Yz4g3pFX O00A== 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=ozrwQiNh1pV14CRMAHtbeUSlZoQ38ER5bTlFizbb0SA=; b=HDjMiiqPsKe6ICzRVQg6y5O3vFHGMnUozeFSIjFeeN/LPienYuW+SXuzgETDI7fE4B 824/SMJJmMoFUAfKA4wfbvSQTLoZudo21/7kXl8h3ujvhkkngC3mMgWp6ivTs8UmBDZr vLqyD+BhuUEfFsG/IoGEvpJ+EcvIpE2Ouzv2ukz2MugFaXBm1S1azDCKFTYPG3WYuf6k DdFrWM6HnOW3IVofW1piLMTXzrCoh2z0eIJC+IAJZOUlYS3b22YC2TOgjHTUBlHrcDuq xjalRdS7nzzuBm5pRj1fV19qJUccKal9+Sh2mDmDtGOP3P2ohtBjVdwkXnylUeJBocbI p3kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Uh1hNCZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si2045051pgi.559.2021.04.15.00.14.04; Thu, 15 Apr 2021 00:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Uh1hNCZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231240AbhDOHNu (ORCPT + 99 others); Thu, 15 Apr 2021 03:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhDOHNt (ORCPT ); Thu, 15 Apr 2021 03:13:49 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C45C061574 for ; Thu, 15 Apr 2021 00:13:27 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id x7so22190474wrw.10 for ; Thu, 15 Apr 2021 00:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ozrwQiNh1pV14CRMAHtbeUSlZoQ38ER5bTlFizbb0SA=; b=Uh1hNCZF+0AAp+xrT2Ecos8yfbD4xsxtWZ85zcGk8XZgazP8Edts9mj6FMTPhrfhSq GwYGwXfmJA7tP5P07Uot3GYNqkoFeTC7eZzzSlb49fiuvy5bz4BlbPODUzDr6P3BAPAu PQfLzYkLjVUSQFo4Eps5jYdX9cCbSPNqcB4s0innXlEa+aZycVtMK2D75q2+iHUyiz+s GOzM/PwL+SFDb9O9Et+FrFHl6M3T+QY9W/YNvrw9QRJYtU12u2A7X2seQB82u5Fder6I qUuF8vl87+cNz5cT7N+TqSNDG1cPSiArNV/X0szy9lAX3FPU2dsrF3b0tU/p+tjnHxPB RJFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ozrwQiNh1pV14CRMAHtbeUSlZoQ38ER5bTlFizbb0SA=; b=t1aZfgbzad7mijKtKRqSTymcThxZ12E1Pr7Ve2Cq/ca33M2ibx0e0q9awOhfpyQ6za RkHHEy/EqIpVEcDBg/OVEMyM1AECIHpDtC4jfi4zQGZZjxHeDGb8MhUcpnEknD5DCDP3 5/vKwtUL+U4wR9WzDQoVBET0tCjVZ4eV14icocvIjOyExodz+ioe6g96B44AB78PQAaI UQY9R+UOONRO3uTwpr3OoKMFr2wOseZrmnfmRDZbj5FfVexShz4kQaemQFOkuM4OZLVA TjYSEGxKmJAnoTdzG5K05Z8XG9ih5HFTH/aJ2Tupc9tcYYyCx7FGpkIT9PTZx6/wAxVc GsFQ== X-Gm-Message-State: AOAM533IlG8S/QUa7idB4pdKsocywdqspKoqN66mA3iuHRhLxNCS6laH /SVzF7PxeoTy+TOtNUeWvDOgD6PcvUvHYB9Tqivemg== X-Received: by 2002:adf:e381:: with SMTP id e1mr1770069wrm.323.1618470805740; Thu, 15 Apr 2021 00:13:25 -0700 (PDT) MIME-Version: 1.0 References: <20210413075155.32652-1-sjpark@amazon.de> <3ddd4f8a-8e51-662b-df11-a63a0e75b2bc@kernel.dk> <20210413231436.GF63242@dread.disaster.area> <20210414155130.GU3762101@tassilo.jf.intel.com> <20210415030002.GX3762101@tassilo.jf.intel.com> In-Reply-To: <20210415030002.GX3762101@tassilo.jf.intel.com> From: Yu Zhao Date: Thu, 15 Apr 2021 01:13:13 -0600 Message-ID: Subject: Re: [PATCH v2 00/16] Multigenerational LRU Framework To: Rik van Riel , Ying Huang Cc: Dave Chinner , Jens Axboe , SeongJae Park , Linux-MM , Andrew Morton , Benjamin Manes , Dave Hansen , Hillf Danton , Johannes Weiner , Jonathan Corbet , Joonsoo Kim , Matthew Wilcox , Mel Gorman , Miaohe Lin , Michael Larabel , Michal Hocko , Michel Lespinasse , Roman Gushchin , Rong Chen , SeongJae Park , Tim Chen , Vlastimil Babka , Yang Shi , Zi Yan , linux-kernel , lkp@lists.01.org, Kernel Page Reclaim v2 , Andi Kleen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 9:00 PM Andi Kleen wrote: > > > We fall back to the rmap when it's obviously not smart to do so. There > > is still a lot of room for improvement in this function though, i.e., > > it should be per VMA and NUMA aware. > > Okay so it's more a question to tune the cross over heuristic. That > sounds much easier than replacing everything. > > Of course long term it might be a problem to maintain too many > different ways to do things, but I suppose short term it's a reasonable > strategy. Hi Rik, Ying, Sorry for being persistent. I want to make sure we are on the same page: Page table scanning doesn't replace the existing rmap walk. It is complementary and only happens when it is likely that most of the pages on a system under pressure have been referenced, i.e., out of *inactive* pages, by definition of the existing implementation. Under such a condition, scanning *active* pages one by one with the rmap is likely to cost more than scanning them all at once via page tables. When we evict *inactive* pages, we still use the rmap and share a common path with the existing code. Page table scanning falls back to the rmap walk if the page tables of a process are apparently sparse, i.e., rss < size of the page tables. I should have clarified this at the very beginning of the discussion. But it has become so natural to me and I assumed we'd all see it this way. Your concern regarding the NUMA optimization is still valid, and it's a high priority. Thanks.