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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E46E9C433F5 for ; Thu, 24 Feb 2022 00:59:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 566FA8D0002; Wed, 23 Feb 2022 19:59:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 514988D0001; Wed, 23 Feb 2022 19:59:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DF088D0002; Wed, 23 Feb 2022 19:59:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 1A7FA8D0001 for ; Wed, 23 Feb 2022 19:59:24 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C909F605A0 for ; Thu, 24 Feb 2022 00:59:23 +0000 (UTC) X-FDA: 79175865006.01.0273B29 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf03.hostedemail.com (Postfix) with ESMTP id A6FE920002 for ; Thu, 24 Feb 2022 00:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645664362; x=1677200362; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=fjSEafBb8ES86rUzsH60Lncm24g7M9CE/uM19ybBuVk=; b=nQszGhDRCbwl+v40EdkN6BAC8J6r8GkoDWFmFShHMJlMBk/tJu4Yz4sJ f5zJrsE0iec7ALPwDYeoXbnXVylLXBeA/abTB4gCOrPfEIa6D5+Z3X23a X5g0gxaZuhMW1sfHmwuoM6ObImHVQ7rqk44T80dLwlRb8UCQI0wotKb0P r91AxcxlagfQUBXgZ492yHwqfSIWiI1b0F4Yad9t0N16ufSgx/ivK38BN QItoSFlVXaaC4BcrtmVl5shLInlTtHzdM43dNVMOY225KBjHvlZdefzRT 5P9ol0bkTnVNTyxNfi1GBXkNwiOUjlzB3EW6pyDI8u3LLiSifQHHBBYxn Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="249699584" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="249699584" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 16:59:21 -0800 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="508666398" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.11]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 16:59:12 -0800 From: "Huang, Ying" To: Yu Zhao Cc: Andrew Morton , Johannes Weiner , Mel Gorman , Michal Hocko , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Michael Larabel , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Linux-MM , Kernel Page Reclaim v2 , "the arch/x86 maintainers" , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?utf-8?Q?Hoffst=C3=A4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Subject: Re: [PATCH v7 05/12] mm: multigenerational LRU: minimal implementation References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-6-yuzhao@google.com> <87bkyy56nv.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Thu, 24 Feb 2022 08:59:10 +0800 In-Reply-To: (Yu Zhao's message of "Wed, 23 Feb 2022 02:36:13 -0700") Message-ID: <87y2213wrl.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=nQszGhDR; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf03.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=ying.huang@intel.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A6FE920002 X-Stat-Signature: c1y6pb8ck5w8hugzpcsbc16jhubsedxo X-HE-Tag: 1645664362-756047 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: Yu Zhao writes: > On Wed, Feb 23, 2022 at 1:28 AM Huang, Ying wrote: >> >> Hi, Yu, >> >> Yu Zhao writes: >> >> > To avoid confusions, the terms "promotion" and "demotion" will be >> > applied to the multigenerational LRU, as a new convention; the terms >> > "activation" and "deactivation" will be applied to the active/inactive >> > LRU, as usual. >> >> In the memory tiering related commits and patchset, for example as follows, >> >> commit 668e4147d8850df32ca41e28f52c146025ca45c6 >> Author: Yang Shi >> Date: Thu Sep 2 14:59:19 2021 -0700 >> >> mm/vmscan: add page demotion counter >> >> https://lore.kernel.org/linux-mm/20220221084529.1052339-1-ying.huang@intel.com/ >> >> "demote" and "promote" is used for migrating pages between different >> types of memory. Is it better for us to avoid overloading these words >> too much to avoid the possible confusion? > > Given that LRU and migration are usually different contexts, I think > we'd be fine, unless we want a third pair of terms. This is true before memory tiering is introduced. In systems with multiple types memory (called memory tiering), LRU is used to identify pages to be migrated to the slow memory node. Please take a look at can_demote(), which is called in shrink_page_list(). >> > +static int get_swappiness(struct mem_cgroup *memcg) >> > +{ >> > + return mem_cgroup_get_nr_swap_pages(memcg) >= MIN_LRU_BATCH ? >> > + mem_cgroup_swappiness(memcg) : 0; >> > +} >> >> After we introduced demotion support in Linux kernel. The anonymous >> pages in the fast memory node could be demoted to the slow memory node >> via the page reclaiming mechanism as in the following commit. Can you >> consider that too? > > Sure. How do I check whether there is still space on the slow node? You can always check the watermark of the slow node. But now, we actually don't check that (as in demote_page_list()), instead we will wake up kswapd of the slow node. The intended behavior is something like, DRAM -> PMEM -> disk Best Regards, Huang, Ying