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 55B1EC433EF for ; Tue, 14 Jun 2022 22:26:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DA466B0071; Tue, 14 Jun 2022 18:26:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 689596B0072; Tue, 14 Jun 2022 18:26:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52B116B0073; Tue, 14 Jun 2022 18:26:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3FF3B6B0071 for ; Tue, 14 Jun 2022 18:26:11 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 11E2620DBB for ; Tue, 14 Jun 2022 22:26:11 +0000 (UTC) X-FDA: 79578275742.23.B0C5061 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf27.hostedemail.com (Postfix) with ESMTP id 8F0A24008E for ; Tue, 14 Jun 2022 22:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655245567; x=1686781567; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=V/U0UGWsGGGf1nHKbOmX9I1mE/XGx/BcO0xINFHGrNA=; b=kuHw9vBwmWuKxkJpH+w+p+/EedHD9G7UO+CZa8FiZYmO7Xb0Fp1zbplI rSL6AymFOadFmaU5bKKKZU8zLJzQOxzor7QQLXkyX0Iy7US/upFiUjqBH Vwo1vparmxaUfUGu1gdd0Do4DqzYBqfOcT4kag3je6x1VlGQergUivst4 YwZf+ygcc9H6PTscEa0Luvkz6HJ2V8NbO4Yp3rXNZmHPNY17CEuvfrKvS dvW8jG4Uk3Pdk88d7PNt7h9YQvXqr+pig2PXhGcvMpfRcgoGLut6PMiQ/ ZnPCwcqqSZ6C0vkiq4GxuCVxQWrJHZsS8TWF5U8uzSs3wz6jUGzMhFzij g==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="278804881" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="278804881" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 15:26:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="588724624" Received: from b04f130c83f2.jf.intel.com ([10.165.154.98]) by fmsmga007.fm.intel.com with ESMTP; 14 Jun 2022 15:26:05 -0700 From: Tim Chen To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Tim Chen , Wei Xu , Huang Ying , 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 Subject: [RFC PATCH 0/3] Cgroup accounting of memory tier usage Date: Tue, 14 Jun 2022 15:25:32 -0700 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655245570; a=rsa-sha256; cv=none; b=DwQUnZMdsuSZYve9J/kuZa60g2xk4kmA4lpSlg9uelFdy/Jv3e7Cg+LYyZse1Mi6JFzl8u quXDQByKMSLGcYjByabFgCQH8AkJ5l3M7QnilT/j/1ZTiniEf7/ff3XCL63zjbucMbapjw cEoxwqmNUnpj/23W0dKzNyQKzztWjLk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kuHw9vBw; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf27.hostedemail.com: domain of tim.c.chen@linux.intel.com has no SPF policy when checking 192.55.52.115) 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=1655245570; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=pcfGmFDNSolJ8eSJC1uCp1o63Cj/f90LQSl1HRU51Ng=; b=MhWd4E+Q8gqbQrcHnOEyic+RKofWjS0pmrJEvs66M2OBWIVtLvEcUjL/twfqd9Kc5M2N8C 7w01+zOttnvQtj5t8AQ003tBg9XKH9YfiZCKzAFNp0DiZE0Q3K2g7plFLyFZn5hk/lPDTf TkvLeCZ3nB4PayypLn/oGBbr0To1uhM= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8F0A24008E X-Stat-Signature: hchof4wjdwaxd3inxa5ack6899hnwwh8 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kuHw9vBw; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf27.hostedemail.com: domain of tim.c.chen@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=tim.c.chen@linux.intel.com X-Rspam-User: X-HE-Tag: 1655245567-939198 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: 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 (3) There are use cases not covered by (1) and (2). 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(-) -- 2.35.1