Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp601399iog; Wed, 15 Jun 2022 08:29:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6+hehNcTgbg5fQzsrZTvACXDGroa0sHzau+n+9CbuF6Ba+rBEFjuAday5jmNKf935ZBD/ X-Received: by 2002:a05:6a00:2405:b0:520:6b82:646b with SMTP id z5-20020a056a00240500b005206b82646bmr75331pfh.24.1655306950174; Wed, 15 Jun 2022 08:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655306950; cv=none; d=google.com; s=arc-20160816; b=SpIr0zlLtf/gPioVb7RBF9mjU7uFBTSowV1fPvXf9jaS8qS1bq5s832mjJUqYqHg50 iXjpcQ4BUIUcXmBuMFM3TisZODK0ErBWt+h+F1wFtKkSqu+starAicst9pShDJEXTflF dOVyLI928fRlxn738mGTLkH605ghFryE3N00yHWGM697yyDkdXu65KtDBryPDB2VlT4b UpfRpAM/IWuhGT6PvDEm4JCFu6sbVh60XfZDJ7+vtRIuvWtWXH+ZNF+IqHZ6SRKq720o g1iaZ7GUgDABVRSyap1FHAZiMfF3Tblpat9ja/WRtHfbNQWK2ANNdQ3tRMI1q57MfhW6 yZ+Q== 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=c1Oap7jwvzZJ06GtsF5rzRsx+OaOWVIjH9VWx1egdJo=; b=bL57W9qe9Ppi6+95Egla8Vp4dN529+NVLFrNvLKwmIpRPBlp2/u4LAeC6cwv+ULp5+ CEb7u0YFwAXjROBwd0TAtOwTDcfWV5b2amPzxqC7eFLQkcwjotjrBcPRmm1GKKfcpglz TGUNvvv35ah0RbQZ9CmN0tctQ6T2eBgZ4+sG46JCS0/q49w9qr1b+OEC2xcEjBjRW5yF O4/xmvH9Y+JYNlmNkGRKzx05oNXChdED4BsznTsK/bD9hJ4sa79W9B4/6vLr/ukkqrSO Wto7QKMi7IQMVBNVZiHg+P+Y6r7tRidBoLnQjcLcd8qERlRIrloc3+Xvz7kZo0F02Mmr qqYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O69YS5MP; 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 h2-20020a056a00170200b00518820f0cbfsi18971584pfc.335.2022.06.15.08.28.57; Wed, 15 Jun 2022 08:29:10 -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=O69YS5MP; 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 S1349551AbiFOPYB (ORCPT + 99 others); Wed, 15 Jun 2022 11:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348298AbiFOPX6 (ORCPT ); Wed, 15 Jun 2022 11:23:58 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C69531C13E for ; Wed, 15 Jun 2022 08:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655306637; x=1686842637; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ykflRw68m1/+YtPghFKGX38ewwpPpqo6gmWZMbFFPxE=; b=O69YS5MPKx7XnxjP2UU4lCeiZ48iyuCydIErohYRWXq1LAjq2pos9oIk G2Z8zoRzVXeXw8XOz9OQQYng4X8oJfc7Yb9Z6cfhIr4lrNlxtHpWE+KXK rWLgDVF6XnbDrR3OU4VRDChxTmHFC6QjLwgfw4MgRW/NcREhPIDCBvd2p NLMeRqu85uV4Prp3i1yJQNKCOxfTs5OpRGe2SXU/clif1xEZT1lQueTss avmL5qQZmegiou9Geiej6U2fIhiZpt3VA/OKBK9FvO3HN3EAZm6Pw5I5v RDoSXOa8Y6Xww4pPHNlKxofESGPh774pv8cKiSdn7BHzlpACkmYXP/8qH g==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="267687500" X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="267687500" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 08:23:57 -0700 X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="712984367" Received: from lgankov-mobl1.amr.corp.intel.com (HELO schen9-mobl.amr.corp.intel.com) ([10.209.78.147]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 08:23:57 -0700 Message-ID: <34f985f63e6dbaa60bb9d1edb6022e83b98304e4.camel@linux.intel.com> Subject: Re: [RFC PATCH 0/3] Cgroup accounting of memory tier usage From: Tim Chen To: Michal Hocko Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Wei Xu , Huang Ying , Greg Thelen , Yang Shi , Davidlohr Bueso , Brice Goglin , 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 08:23:56 -0700 In-Reply-To: References: 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 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Wed, 2022-06-15 at 13:11 +0200, Michal Hocko wrote: > On Tue 14-06-22 15:25:32, 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. > > I guess you meant cgroupfs here, right? Yes. > > > 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). > > I would start by asking why do we need a dedicated interface in the > first place. Why the existing numa_stat is not a proper interface. Right > now we only report LRU per node stats. Is this insufficient? > What is userspace expect to do based on the reported data? Exporting the toptier information here is convenient for me for debugging purpose of seeing whether a cgroup's toptier usage is under control. Otherwise writing a script to parse numastat and the memtier heirachy will work too. Exporting toptier usage directly is optional and we don't have to do it. Tim