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 7EBCEC433EF for ; Tue, 7 Jun 2022 19:49:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9CF16B007E; Tue, 7 Jun 2022 15:49:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A24056B0083; Tue, 7 Jun 2022 15:49:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89D836B0085; Tue, 7 Jun 2022 15:49:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 741FF6B007E for ; Tue, 7 Jun 2022 15:49:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2FDCF20E8F for ; Tue, 7 Jun 2022 19:49:17 +0000 (UTC) X-FDA: 79552478754.25.A7955C0 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf28.hostedemail.com (Postfix) with ESMTP id E0023C0062 for ; Tue, 7 Jun 2022 19:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654631355; x=1686167355; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oa7be7baBm0n3iWafiYaE07e1MExtPBJOGW0P5KwdXY=; b=OFmqmzgSPPEtBZ4qiCDzWH+yNIMNTDm3H3ZvmlS9Px680HZjRPcCV0wL WSg1A4+/kdgNjl1Q2PgEe5394l2FRpV2/dhfMvW3OYisu6ho/iUl9Ybyf AuT7PzjOvtTpqrSm/bekjLySVVq8z9bZGN92eHwTQl4lbF0FNcyYaX/z7 iMi0+qf1Ha0d1H/aQV5kK6n64wFEj71724CF0lP11TpzTJopHb39oixQY i2uXFucK0FG53GwXuUq4Bo9wz7iIElPIc14LZ55a8A+cvbb9RR2OTbAIn Z+ikzj2SRCYswTee8mnMEI5TZZqdtNNEY5S3QTMUncUlDGWgV1AtApPRB A==; X-IronPort-AV: E=McAfee;i="6400,9594,10371"; a="277395552" X-IronPort-AV: E=Sophos;i="5.91,284,1647327600"; d="scan'208";a="277395552" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2022 12:25:44 -0700 X-IronPort-AV: E=Sophos;i="5.91,284,1647327600"; d="scan'208";a="648191587" Received: from schen9-mobl.amr.corp.intel.com ([10.251.8.166]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2022 12:25:43 -0700 Message-ID: Subject: Re: RFC: Memory Tiering Kernel Interfaces (v3) From: Tim Chen To: Jonathan Cameron , Ying Huang Cc: Wei Xu , Aneesh Kumar K V , Andrew Morton , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Alistair Popple , Dan Williams , Feng Tang , Linux MM , Jagdish Gediya , Baolin Wang , David Rientjes Date: Tue, 07 Jun 2022 12:25:42 -0700 In-Reply-To: <20220530135043.00001e88@Huawei.com> References: <1281d918c07b05ac82aee290018ad08d212e0aaa.camel@intel.com> <20220530135043.00001e88@Huawei.com> 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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E0023C0062 X-Stat-Signature: mwup5fu4qt69poj1kmn1pbknqe68jz18 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=OFmqmzgS; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf28.hostedemail.com: domain of tim.c.chen@linux.intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=tim.c.chen@linux.intel.com X-HE-Tag: 1654631353-268372 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 Mon, 2022-05-30 at 13:50 +0100, Jonathan Cameron wrote: > > > When discussed offline, Tim Chen pointed out that with the proposed > > interface, it's unconvenient to know the position of a given memory tier > > in all memory tiers. We must sort "rank" of all memory tiers to know > > that. "possible" file can be used for that. Although "possible" file > > can be generated with a shell script, it's more convenient to show it > > directly. > > > > Another way to address the issue is to add memtierN/pos for each memory > > tier as suggested by Tim. It's readonly and will show position of > > "memtierN" in all memory tiers. It's even better to show the relative > > postion to the default memory tier (DRAM with CPU). That is, the > > position of DRAM memory tier is 0. > > > > Unlike memory tier device ID or rank, the position is relative and > > dynamic. > > Hi, > > I'm unconvinced. This is better done with a shell script than > by adding ABI we'll have to live with for ever.. > > I'm no good at shell scripting but this does the job > grep "" tier*/rank | sort -n -k 2 -t : > > tier2/rank:50 > tier0/rank:100 > tier1/rank:200 > tier3/rank:240 > > I'm sure someone more knowledgeable will do it in a simpler fashion still. > > You can argue that $ cat /sys/devices/system/cpu/cpu1/topology/core_siblings f $ cat /sys/devices/system/cpu/cpu1/topology/core_siblings_list 0-3 provide exactly the same information and we should get rid of core_siblings_list. I think core_siblings_list exists to make it easier for a human, so he/she doesn't have to parse the mask, or write a script to find out the ids of CPUs who are siblings. I think in the same spirit, having an interface to allow a human to quickly see the hierachical relationship of tiers relative to each other is helpful. Tim