Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1573354pxb; Sat, 17 Apr 2021 23:54:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJdXtb+ZvhnykeU5P0aqX66Fh+4yKDY1353otOFKgXCd5LJvE+5p+Y6f9qVCIW1ezj2CMp X-Received: by 2002:a05:6402:1a2b:: with SMTP id be11mr18994053edb.304.1618728841410; Sat, 17 Apr 2021 23:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618728841; cv=none; d=google.com; s=arc-20160816; b=A+TRGgNKrxzJ9U4ntpSI4277s77XI8tTbtxW+ajy92d+wlUZrq493cl+HwsdCJa4IV 9hSeniHYNSwhjxAxWKicC/aKujIXZLzYQlG6N0iSHtY/M2BNdKczXFFCPgF8eQ+mKZ3X X2tmlgpOxO2qcuTOThjetbt1QCdrd5vDNwgey7fjtKpPdu+HqAtNi1h8z/GHm1pg4+sq NUeLC13Kj8uO6PhpPAPZiDAaAyVSzi2z37eiH/AS9rAA4R8KYvCI60MdRkVwVeyfStSy HoWthGbuRaLLPBjoFOJmbq1hNl1cps0vw/p/6yiW3uC+sS/T/yzqIr6B6X0fI3XWPexP G/NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=32BZ+U1/+vujlcDitqQfqCs8E48UwSHYgwSNpIYuZYg=; b=HTc5GJHlw5ATC3JHj5p/hcWkd3Vyi/SaiGMQ4lkTR/jFX8EZsd7MUF/IJlf54Urd48 SylZftKOH1Lsm2jHVGqbgI5YBhbnMOe4zRPQIbD9hY9VHv1YRuFy64fQak1mupX1FtIf JRymeHmJIPm6It1gYzKJIXubl3OH0az6eEFGMIy8iU4gm5TYGymByQqH3UGZAjcKhaJ8 iH9H4XO9NglVw13Oy30mibAt9T19LjyW+t47Z82vBtIKN2c6XgWr9azLYeSJP41fdNRV sNMGAnuEE0poYjjoSkF1k3mNJXaJoIfg+tEC884udZcOo1QWKEknXlih71EvQm7URHJY UJcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-12-ed header.b=0OnnkKxJ; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-12-rsa header.b=A5uiV4M0; 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=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si8515679eji.300.2021.04.17.23.53.28; Sat, 17 Apr 2021 23:54:01 -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=neutral (no key) header.i=@lespinasse.org header.s=srv-12-ed header.b=0OnnkKxJ; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-12-rsa header.b=A5uiV4M0; 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=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbhDRGtO (ORCPT + 99 others); Sun, 18 Apr 2021 02:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbhDRGtM (ORCPT ); Sun, 18 Apr 2021 02:49:12 -0400 Received: from server.lespinasse.org (unknown [IPv6:2602:303:fcdc:ce10::100:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E6AC06174A for ; Sat, 17 Apr 2021 23:48:44 -0700 (PDT) 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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