Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp1075865lfn; Wed, 23 Feb 2022 18:25:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzuxuoVTPtCbrQlt5PYxNpr/mDAltVor25zgPuSWndfLUoqFs7usqLmxNcHerxEnQpn9Ud X-Received: by 2002:a17:903:3093:b0:14f:b5f7:45aa with SMTP id u19-20020a170903309300b0014fb5f745aamr413083plc.121.1645669503338; Wed, 23 Feb 2022 18:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645669503; cv=none; d=google.com; s=arc-20160816; b=ooDepM4jfDZkWKjLbnJUcIgcAqNdA//GQ4WDlsjgxlZ4s8WpG/hibagpttifkgrulo KplJGj3gyQkK6NMCP6XZ8WiOmks+BI8FRpmt180CFCA434s78Ol+LXh7or8CO4jMnAE9 +p3gCniXH2UgM2kXCys94M4J9Nq8StsYthhaHKVsdZlNdi5Xu1IAZrk1i0dkIJdnIPpU tPEw7aiuc6Leb5cNfC1gcg0cMNVamusSMfprbu6Tqfe1Crg9Eg2hApKy/MhjDlUaKDOe TBru4WcZHzJy8PDUSyeNi3fLtH66Gu49YkB6tLrZSDrQ+JypyCeSCUgpjF6oENdmJ/ST 27Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=+PZ0OI5QMRcRD1+kledBp8vr6+4AN/4K/LFpmLasarA=; b=fLfw6uSqb7QR4NHRg9AGllU3uNWCu1XbVAhpaRkEUeYDWX01+H+0j8GHKSOSfozZqx dHDc1cqb/lySTlt7s6EcbxYifFFNNEhnW7LetSHFOWUJL48pd7uIMghi1609GIM6eJjU N9Qs0bk32mgkL5m8PKC3mJegbemk6N1GHHKZH5grqi9FrpxS3FVlVAYyzySJFdu9FvVm 8fwcwJctYDvjo+ZFhBlpXiA4K5uCLoH9uAhIDuxt4GK+4xkWcb7Glic43SU883GNVxep dNWQIMLrE0/7107ySbQ4966l1k9hana+Ouq1ZzYbj/d+LzIVdSqGv24EkWDM0mY/BJsN Hrbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5kqjrQM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u36si1314458pgk.23.2022.02.23.18.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 18:25:03 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5kqjrQM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D43701E2FCF; Wed, 23 Feb 2022 18:25:01 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbiBXCZY (ORCPT + 99 others); Wed, 23 Feb 2022 21:25:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbiBXCZR (ORCPT ); Wed, 23 Feb 2022 21:25:17 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F052B22EDC8; Wed, 23 Feb 2022 18:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645669489; x=1677205489; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=fjSEafBb8ES86rUzsH60Lncm24g7M9CE/uM19ybBuVk=; b=D5kqjrQMcyRQp7ovkBK7UBZ02i6B7vkoyQvI9ZV0ycNWVQEYXOFabKvS ZQ5u+7tD+L/OTipiN+7aZMDKtDEKSEFbZ9dzglBrn4lNaIi4asiycsTHi j1Kxnphm3pjmxUw43LMPi5Gx/7LE+Tk/GTZogpCoFpfQEuWzDeSfbv86/ IK1LXUiS4bpk+ER9W0smh9xp9ddAFM6II511xlT14ylbpSxuipqiXFV97 IcgyImXEu+rHdSiLqaubo4mLlfqQst/UPdH71uTh9UnKchdXffDD3sbPk qJz8/jOTN7Ndx9LO882Pp1MnmHujLANtJnuELjQXHTnvlBpSmyFr/hUlj Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="235628028" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="235628028" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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