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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BADE5C433ED for ; Sun, 18 Apr 2021 06:48:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3BA946121D for ; Sun, 18 Apr 2021 06:48:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BA946121D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=lespinasse.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8759E6B0036; Sun, 18 Apr 2021 02:48:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 826146B006E; Sun, 18 Apr 2021 02:48:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69F956B0070; Sun, 18 Apr 2021 02:48:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id 4FA326B0036 for ; Sun, 18 Apr 2021 02:48:46 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F27AB8136 for ; Sun, 18 Apr 2021 06:48:45 +0000 (UTC) X-FDA: 78044559810.35.0A95AA2 Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf02.hostedemail.com (Postfix) with ESMTP id 90C5B40002CF for ; Sun, 18 Apr 2021 06:48:25 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-12-ed; t=1618480628; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=32BZ+U1/+vujlcDitqQfqCs8E48UwSHYgwSNpIYuZYg=; b=0OnnkKxJXqb8GR8MZAGnbjDPtjW/EABxAT7cd8D7DqI8nAXFazIpQcTTVoJG4kDl08jy6 wfmILx3TmwfVfZVAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-12-rsa; t=1618480628; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=32BZ+U1/+vujlcDitqQfqCs8E48UwSHYgwSNpIYuZYg=; b=A5uiV4M0DOAsXYAeYPSUqTa2XZg2g7gantNn74Umk8eJraWtYeLlQ/p7YneMchGDax0aW pkHJP650JjBuCwsginSUcqHkVFkoSk+m0FqJPHVN9hiCWP7s8THvy+ElRPlKNLX9oqg0DRn OQVzD4mae1b0HmtZ6eK/XroQcCYBbv/MMGk6iNKTWcy4Yw0krhCjExRDIYWbnWZdUHkwF5o InSRwYB64Fhm/QLkRIaNkqHP6lr2wS0SwMhFUIoCLxG7p3lMWhgsJ8hv5oG8ha1s5dyMT95 8db5YQhZ9cwZb3PVx4M+IKyY+MkHW28nSwZpCscT8zb04bwPbx7X+BWJVy8w== Received: by server.lespinasse.org (Postfix, from userid 1000) id 2EB59160527; Thu, 15 Apr 2021 02:57:08 -0700 (PDT) Date: Thu, 15 Apr 2021 02:57:08 -0700 From: Michel Lespinasse To: Yu Zhao Cc: Rik van Riel , Ying Huang , 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 Subject: Re: [PATCH v2 00/16] Multigenerational LRU Framework Message-ID: <20210415095708.GA6874@lespinasse.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 90C5B40002CF X-Stat-Signature: yj6bsgq1jjz8bebxqo91b74z3m8xt5aj Received-SPF: none (lespinasse.org>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=server.lespinasse.org; client-ip=63.205.204.226 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618728505-67768 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 15, 2021 at 01:13:13AM -0600, Yu Zhao wrote: > 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. Could you expand a bit more as to how page table scanning and rmap scanning coexist ? Say, there is some memory pressure and you want to identify good candidate pages to recaim. You could scan processes with the page table scanning method, or you could scan the lru list through the rmap method. How do you mix the two - when you use the lru/rmap method, won't you encounter both pages that are mapped in "dense" processes where scanning page tables would have been better, and pages that are mapped in "sparse" processes where you are happy to be using rmap, and even pges that are mapped into both types of processes at once ? Or, can you change the lru/rmap scan so that it will efficiently skip over all dense processes when you use it ? Thanks, -- Michel "walken" Lespinasse