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 21C4BC433F5 for ; Tue, 31 May 2022 01:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68A866B0072; Mon, 30 May 2022 21:57:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 638626B0073; Mon, 30 May 2022 21:57:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 549506B0074; Mon, 30 May 2022 21:57:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 46B2B6B0072 for ; Mon, 30 May 2022 21:57:33 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 1CE4B12013C for ; Tue, 31 May 2022 01:57:33 +0000 (UTC) X-FDA: 79524376386.16.809F583 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf28.hostedemail.com (Postfix) with ESMTP id A0C1FC005C for ; Tue, 31 May 2022 01:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653962251; x=1685498251; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ySX0o1a0NBK1KoPB58FGYm0+GQ6XT4BanItUrrpKDuo=; b=n8ua/7HuekS1qZehaoQcLdil8YQTLbJinfSPLy8/Zyrf6liR/7TMMflW MFchrKAEc560yhukNg7PA9umRiBQ95Xp1x3WGYjy5GBb2HVsLSQ1TxedW Dyn4XAYvoUL7nOh+BQiGhvucx93yJR7a9dXI7TS9AczlH4dQINhP8ILJD 9GkXeu3SP2zQllhSMwDqiwgfvVawUg00iO84MV11Vp+CTrmIPzfXg95Qu PLqNPuO0G082/sMvstwmod/rkCIZL5IQrh8oVrNR9pDZ7s2M9z6zu3K9y vB4iMtQwDAMluCoE2X6Y1cheiGqDaNTOip00HP8KE9nqFq5nC0R15BDhG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="254984904" X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="254984904" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 18:57:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="605413674" Received: from quanliu1-mobl.ccr.corp.intel.com ([10.254.215.142]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 18:57:23 -0700 Message-ID: <4456dc2520cf2d9368c320eb628e0043d59dfb2f.camel@intel.com> Subject: Re: RFC: Memory Tiering Kernel Interfaces (v3) From: Ying Huang To: Jonathan Cameron 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, 31 May 2022 09:57:20 +0800 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.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0C1FC005C X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="n8ua/7Hu"; spf=none (imf28.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: hwiyq5cms9gqyfp7zrrid631bp1nczeo X-Rspamd-Server: rspam05 X-HE-Tag: 1653962213-437047 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: > On Sun, 29 May 2022 12:31:30 +0800 > Ying Huang wrote: > > > On Fri, 2022-05-27 at 09:30 -0700, Wei Xu wrote: > > > On Fri, May 27, 2022 at 6:41 AM Aneesh Kumar K V > > > wrote: > > > > > > > > On 5/27/22 2:52 AM, Wei Xu wrote: > > > >    > > > > > > > > > > > > > > > > >    The order of memory tiers is determined by their rank values, not by > > > > >    their memtier device names. > > > > > > > > > >    - /sys/devices/system/memtier/possible > > > > > > > > > >      Format: ordered list of "memtier(rank)" > > > > >      Example: 0(64), 1(128), 2(192) > > > > > > > > > >      Read-only. When read, list all available memory tiers and their > > > > >      associated ranks, ordered by the rank values (from the highest > > > > >       tier to the lowest tier). > > > > >    > > > > > > > > > > > > > > > > > > > > > > > Did we discuss the need for this? I haven't done this in the patch > > > > series I sent across. > > > > > > The "possible" file is only needed if we decide to hide the > > > directories of memtiers that have no nodes. We can remove this > > > interface and always show all memtier directories to keep things > > > simpler. > > > > 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. I am OK to leave this to be added later if we found that it's useful. Best Regards, Huang, Ying > Jonathan > > > > > Best Regards, > > Huang, Ying > > > > >