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 BB044C433EF for ; Wed, 15 Jun 2022 04:59:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C99BB6B0071; Wed, 15 Jun 2022 00:59:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C22766B0072; Wed, 15 Jun 2022 00:59:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9B926B0073; Wed, 15 Jun 2022 00:59:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 958266B0071 for ; Wed, 15 Jun 2022 00:59:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4428235498 for ; Wed, 15 Jun 2022 04:59:02 +0000 (UTC) X-FDA: 79579265724.11.F15184B Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf02.hostedemail.com (Postfix) with ESMTP id 64618800A3 for ; Wed, 15 Jun 2022 04:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655269141; x=1686805141; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=dw66JPwioy0ZxhOB3enfq+e+5LXA5Jwr+DWaxTerOp4=; b=hr1jvDSxrt2E1FBlgVUCXYH9x/tIjp8Pkdh+LNxGZloEB3EIsTx21rkk 49sjKTnoaAm6sMO6apiLNgzuW86VQVnoUUbXMuH6kQsylQDoAg3P4u2Mq OJVuiZZxAEFespXjxQNrnNN3LRWrfJo/cj0XaTOmelBNPtiX7Df2NutYw 3SccEgQLfJFq5Qxx5HFqMajZuC4md+NElHP6ZnymuPcA/UIv1TttG1TEL imco/4hTv7o4f3yuDsvvXMEONjE8SOrUxRdh2WvoYHQuW2bvZ+vtulWz+ hyUEcU7N+Qp6uxrWn8XxopbILZpWgM4OAYBup8SUbsFaioV5opHrOnBBM g==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="340498687" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="340498687" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 21:58:58 -0700 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="640781265" Received: from yutang-mobl.ccr.corp.intel.com ([10.254.214.55]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 21:58:53 -0700 Message-ID: <68b6a7e92d48a3285a5707378459bb9ae805f333.camel@intel.com> Subject: Re: [RFC PATCH 0/3] Cgroup accounting of memory tier usage From: Ying Huang To: Tim Chen , 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 12:58:50 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655269142; a=rsa-sha256; cv=none; b=1RwlbYkfNYSG9os0XrcflDygfItmDM/69FQebcGxMcfaPlkR1ktHurko0P4ohU7T0sUqrW JsP8Z37So3Vjkfg0nHCr8eXOndBzQ7QRBUmAq0JAueHXfYBFJdrk/5FhYwnHkgeEW+WDfm wOu1shARgwk0N46ghhCLsNxE/WEU6r8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=hr1jvDSx; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf02.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655269142; 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=o495SPpK7NNzIQl0ylB51J9oFLhjwcePcJ4PFNtxecI=; b=PJLkDbor0her8CRyTlGJe8lOSW+5ggzhsEdd9oZ9QirZGGEHx5D26nVeUI0S9j7OHCb9z6 TX3vbYktlPuh6OPUHWqoZLtedl9V5rB4DylExgTj2l1mOMux6OiN2rDblHBO4N2cwFcokM 6GbPXLdQkeHcSDCGXgwQBHMpXHvETss= X-Rspamd-Queue-Id: 64618800A3 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=hr1jvDSx; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf02.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=ying.huang@intel.com X-Rspamd-Server: rspam06 X-Stat-Signature: q17iw9gbo7eeiffxo18uspphwg7fg8eh X-HE-Tag: 1655269141-869959 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 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". > (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. Best Regards, Huang, Ying > Thanks. > > Tim > > [1] https://lore.kernel.org/linux-mm/20220610135229.182859-1-aneesh.kumar@linux.ibm.com/ > > Tim Chen (3): >   mm/memory-tiers Add functions for tier memory usage in a cgroup >   mm/memory-tiers: Use page counter to track toptier memory usage >   mm/memory-tiers: Show toptier memory usage for cgroup > >  include/linux/memcontrol.h | 1 + >  include/linux/memory-tiers.h | 2 + >  mm/memcontrol.c | 86 +++++++++++++++++++++++++++++++++++- >  mm/memory-tiers.c | 3 +- >  4 files changed, 89 insertions(+), 3 deletions(-) >