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 0BB4BC433EF for ; Wed, 15 Jun 2022 17:47:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EBB56B0071; Wed, 15 Jun 2022 13:47:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AF066B0072; Wed, 15 Jun 2022 13:47:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83DC06B0074; Wed, 15 Jun 2022 13:47:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6D95D6B0071 for ; Wed, 15 Jun 2022 13:47:16 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4790620571 for ; Wed, 15 Jun 2022 17:47:16 +0000 (UTC) X-FDA: 79581201672.17.F297FB8 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf08.hostedemail.com (Postfix) with ESMTP id 452CD160087 for ; Wed, 15 Jun 2022 17:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655315234; x=1686851234; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=9HiCA51SRONvHgM/bRjjatEdWaF6sXtZEEtO7ayhDgs=; b=ev2i8k1vBwTofjfaRplB6ukYHqA/qPDlq47PpMseTJGewBEdqf6ZYh6n c1VNawe5qmdyFhQ07JsQQwbgM1XZQqr3VqbueZfBW+ebXdWTvDgqAA+rq az7vyyaOxDTTUfsx52PpPpAaPaIzdbzsGHUuvDPYnLgWVO5zxBdDiwjZa pKQFd53sLgD2igiR1woyi7kBkNH81+dh1Vwe5qkimW51ULSLfw6t/AHI+ ddDNP3nXa9hcmFXD3qvYF2Lp3xQayKYtk2jkpWfTxqAQvPsdMcWrCZof2 IAy8kPpxm706/W4y5MJnKdgID8c3ZKkTGySkkWI6no3ByltmkBjLDRCU6 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="258907121" X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="258907121" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 10:47:12 -0700 X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="536143684" Received: from schen9-mobl.amr.corp.intel.com ([10.209.78.147]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 10:47:11 -0700 Message-ID: <64e3e50508b0bf27ed5d6957161e2b3631c1164b.camel@linux.intel.com> Subject: Re: [RFC PATCH 0/3] Cgroup accounting of memory tier usage From: Tim Chen To: Ying Huang , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Greg Thelen , Yang Shi , Davidlohr Bueso , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes , "Aneesh Kumar K . V" , Shakeel Butt Date: Wed, 15 Jun 2022 10:47:11 -0700 In-Reply-To: <68b6a7e92d48a3285a5707378459bb9ae805f333.camel@intel.com> References: <68b6a7e92d48a3285a5707378459bb9ae805f333.camel@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655315235; a=rsa-sha256; cv=none; b=p8q/he5maS2xAcOZNbJUCJBhiKvlxXg4qPjwfNTDZOIZ/QdIFXkPcEuceViN4pWPE3fb2k ku/recSVPXjdDRBkQ5f3bRpY47mt2akAdefiluj30XXFsIoVZvvNyrcxkMTtRN9JSY75En jY3OULi5/0b3Qt8/+G11Pig9hH4iRmQ= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ev2i8k1v; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf08.hostedemail.com: domain of tim.c.chen@linux.intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=tim.c.chen@linux.intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655315235; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kt1gpY2eMrtPz0iCaPvaeCLE+2zxcDJRbPrsUprW+nM=; b=PdSsZ+hEgJ7qx1Bf68KknNkE75WeWtCeV6Z3+vwm1eQhC62qefC7AurM2S1LnkvownODaH MWJKDs8veQ+DTJzSslspeXjJbJ3KGiAK+VnY0ABL47PUafbuu+VQYY+sYp8BO0I/SzL8Ke /7kOz3I9ujBDwNfTmuxzFH6mvsW08FE= Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ev2i8k1v; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf08.hostedemail.com: domain of tim.c.chen@linux.intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=tim.c.chen@linux.intel.com X-Rspam-User: X-Stat-Signature: iks5ctwqomcew6ndyy8nxaxqqdfzccri X-Rspamd-Queue-Id: 452CD160087 X-Rspamd-Server: rspam08 X-HE-Tag: 1655315234-643667 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 Wed, 2022-06-15 at 12:58 +0800, Ying Huang wrote: > On Tue, 2022-06-14 at 15:25 -0700, Tim Chen wrote: > > For controlling usage of a top tiered memory by a cgroup, accounting > > of top tier memory usage is needed. This patch set implements the > > following: > > > > Patch 1 introduces interface and simple implementation to retrieve > > cgroup tiered memory usage > > Patch 2 introduces more efficient accounting with top tier memory page counter > > Patch 3 provides a sysfs interface to repot the the top tiered memory > > usage. > > > > The patchset works with Aneesh's v6 memory-tiering implementation [1]. > > It is a preparatory patch set before introducing features to > > control top tiered memory in cgroups. > > > > I'll like to first get feedback to see if > > (1) Controllng the topmost tiered memory is enough > > or > > (2) Multiple tiers at the top levels need to be grouped into "toptier" > > or > > If we combine top-N tiers, I think the better name could be "fast-tier", > in contrast to "slow-tier". > I can see use cases for grouping tiers. For example, it makese sense for HBM and DRAM tiers be grouped together into a "fast-tier-group". To make things simple, we can define any tiers above or equal to the rank of DRAM will belong to this fast-tier-group. An implication for page promotion/demotion is it needs to take tier grouping into consideration. You want to demote pages away from current tier-group. For example, you want to demote HBM (fast-tier-group) into PMEM (slow-tier-group) instead of into DRAM (fast-tier-group). The question is whether fast/slow tier groups are sufficient. Or you need fast/slow/slower groups? > > (3) There are use cases not covered by (1) and (2). > > Is it necessary to control memory usage of each tier (except the > lowest/slowest)? I am not the right person to answer the question, but > I want to ask it. > I have the same question. Tim