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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD26DC43334 for ; Tue, 14 Jun 2022 22:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245277AbiFNW0K (ORCPT ); Tue, 14 Jun 2022 18:26:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233939AbiFNW0I (ORCPT ); Tue, 14 Jun 2022 18:26:08 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEE8F4D616 for ; Tue, 14 Jun 2022 15:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655245566; x=1686781566; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=V/U0UGWsGGGf1nHKbOmX9I1mE/XGx/BcO0xINFHGrNA=; b=JtL8Am0bLdcxGyd+w9a11/2AXAXUm8e4r6YOGSpKUWJow69pRv86kfke H8P5dAF6cOkAg5hOvxieWVjAgb3qp6W95yO8FNtZEGuUTzdZN3EZN31f5 2vV+nDLw6xqSjiN7JMEDfAZGSR8+qSGxg/OsHn6Gz8Drg8djzVydFsk9W dyd1uA3y8UywmEA6a0QQNpwX1FzUJCaZejfXeYYxnbVpvA4EyBdSQdeIU Z1lhfcpXnvQ+jIu7PdFcttAdHseuZ/EBQJl8F3qofFRkNilLMmnvZBY4T YJV4NUnA3C1Yv/2NJ2WTvnkJs5hXCwRYStxHjf/15LOlTdcEqYHnDrlC+ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="259217320" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="259217320" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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