Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp147847iog; Tue, 14 Jun 2022 22:11:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6uM5EpjE1msMDsW7inbmvBVZS3v6m3zoZxYu3HvYzmgoiJq3DAYi0bRrfAUJbWmO9bp7T X-Received: by 2002:a17:90b:1b4c:b0:1e4:dac8:29e0 with SMTP id nv12-20020a17090b1b4c00b001e4dac829e0mr8338843pjb.36.1655269865475; Tue, 14 Jun 2022 22:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655269865; cv=none; d=google.com; s=arc-20160816; b=EwEt6qRWt0B3cxgyxXjBb/Nne1A5ru+SsTS24Lc0LUmvb39iXrjUykAvrSN1um7nf7 aAhnA0Y1rleopJ8wPeQtE0XSO42UD1UJdnIZ3Xlcr9fUwqBD8jEnDfxNT6eTgcSMpDVL K2JHJlttpGo6uky6QRwX7clO6Y2AJsbtshRVnL9KjZrr6WD/HdEsTk7adyIFjaZVR8mt N6wyeawKw6P/JNrB7+pQqFIDTUJzSZ6Oe3PoogIDSrtSkyzEeiLg5b6KI22in172bfxT Li9eBT9qaE1iuz2Mw80cuTcnqi5qDr5/JvdQADUaIlkxgrceFX1PUhk+GM2CNWrPQ9W0 m6FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=o495SPpK7NNzIQl0ylB51J9oFLhjwcePcJ4PFNtxecI=; b=JE+A2VAxUB/edhlCWD5OSvFtEqbNwNuhLMp2ZcWsNjSmzW/gcF5WRlh6HwAV1Vn/Qb 07MguzYgiyneFFKsjw6JKJzS8y3WYUcFtPbkcvBV+5hj0+dbXC5Ky7LhZRNYeomLNQYA czsDvMb/jz316PMlKmBrAZH7gNCX7Wh45wpywPGV2yd2N9+aL4x9jRHhGI7TXsbb/6/u HP4z9avdhymhb3LHE2OVo/E7NcEEt5hU4M/ral1W465Dbk9Ut+Ke/IbxBDZMuXw2aExn 95COkm+fzKfqSb+H28kFg3sfKWdz74417OwrRaaiskaq4lsCampTIPYSMJWbkRNi/Stf T5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fOnK8idt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a63f905000000b00401ae0f4a06si15762459pgi.577.2022.06.14.22.10.52; Tue, 14 Jun 2022 22:11:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fOnK8idt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242743AbiFOE7B (ORCPT + 99 others); Wed, 15 Jun 2022 00:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237310AbiFOE67 (ORCPT ); Wed, 15 Jun 2022 00:58:59 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50A83B016 for ; Tue, 14 Jun 2022 21:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655269138; x=1686805138; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=dw66JPwioy0ZxhOB3enfq+e+5LXA5Jwr+DWaxTerOp4=; b=fOnK8idtLMzvqr7FJXNpTZqhEYJ6/yPmaCoaVoq69NfQXaypCPvdHosZ vPTMIwyVqIzZ2ZMoWBWKEtHHkDxe6Yq1x4aSHtu6NxA3ZQQp9QXMaLWul NmdJJk3Kl57JXZzVOLizbExNuQRgDX7HYYlJvC8hl0ZVofxzJpjtq7NsI dfAJont/pbSNpx2rTPUmT78JDCKrdga0cRWfR1TMvgqi7O+VVTvJ2rljd Y0yrrkT+4ONmXwalSyWMZU1A+xx2FG4ji1ktMP1DuyPzpI7eHMT/oJ4AU 5+zSEzoUlTXFzwIn5oVsboNBx9lgcEQoUHf+75vxfXyyDGttVrprf72LV A==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="340498688" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="340498688" 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 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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(-) >