Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197815iof; Tue, 7 Jun 2022 22:57:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydhvQ8YX34ndeKj9JI2p+Q2pEggpT6NZ4GmUA3MbZ7rWRsQnuDFH5mURTHAaG/2PfzGnMK X-Received: by 2002:a17:90a:5301:b0:1e8:41d8:d0f5 with SMTP id x1-20020a17090a530100b001e841d8d0f5mr26296436pjh.175.1654667851019; Tue, 07 Jun 2022 22:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667851; cv=none; d=google.com; s=arc-20160816; b=cir0XM8Vwf0Afc0Iwhr8maCJCjQLyJzAeWG2T6SKcF02wnylDel8dip++3/XXUyg3J MMFgqJQU6IjneXjO+3BZsgtqfCp3iSqTYKGr3F307O8dRUjmDKeJACYbki5jSSpF3uAs 4b6Ts5aiAkqhL1vL2VMsyLiBUAuhL0OpM9X7u3hJf/JvLL427YBrw1sSdDaBJ/GbWHu2 ztakPH/XJHaoTQSJQ3X4zP3Ebc4EBbP9eAfo0wC6OwFNlBdJofseTVp1WVQcZKRPB9cm ui3Zlz5+v3OxanBzivf0uHhP+n/r8vViaUxLeY5x5t3d3za2d2OaL4Wo+vkkgoX2qg5T CMVA== 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=+l58MBS0yfIiqwhpIgCMvK1s72Cev9O+/E2x/jtWO0g=; b=WLI6BKbLaXHNPqR7SyU6UvcrzasEip00eHSx/K/hZBg04X7SfYJdZ3UZJz53HDjyqP P21qP94S7qTudJvLQ2DcJR55vfacspwCbGGFCELkBn2Zoet2GwdAnpKFCf64+dZG6kOW SUiqjTrmybIg8Gt6MmaoO9OKauD4w5x4kiDFVOct4N1Hp+eEpJpeTn4N0NsF10RuxJXa rrnSoguse0IfVKfiifypvIRkScb2y06xitLExic1WvXmvw3GCp+6clpEzpOBnG4F7muC aHBsnmwnN/qmgdRHjubB+ryVol/8xyFz0p7ADb1qFW82aNeNiOMsUOD3M4KiBjvdUQ1N 4+PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NZRY0VkM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e63-20020a636942000000b003fdaf27163fsi11923751pgc.339.2022.06.07.22.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NZRY0VkM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D64B4B3F6F; Tue, 7 Jun 2022 22:23:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390315AbiFHBAE (ORCPT + 99 others); Tue, 7 Jun 2022 21:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444566AbiFGXCZ (ORCPT ); Tue, 7 Jun 2022 19:02:25 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4684E326E7 for ; Tue, 7 Jun 2022 13:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654633004; x=1686169004; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oa7be7baBm0n3iWafiYaE07e1MExtPBJOGW0P5KwdXY=; b=NZRY0VkMkU4hjAluTfXZueOenewEyMYuH3Otia7qX/tgOLA+GVp1jKFT W+ffZ3gOjYiuJbJw5g9PdCTod2/bArtIUSCgSPIIvPpayurkuI/tXmr/d ttXC4U1cqlUWhcN4RtQ+TznPtpeBUKzI2B43jDDK8/2NOz0J7CsSWQH0t DXEtGgk5oNGa/Y4PFhMAePFxhf5SKsFDrchST1y0bvHcYHKHBnwtf3lMI Gd8Znhh5yd5frTvdqArEi9ioHOxEYlru/hqx7bsk3SSvqKcm+yeJGFV8n ktWhEMZHefUYqUeXkhpAkeezdpaJ7L9Lfr01691ZI2GYzHVd+wyHuzoyQ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10371"; a="338333000" X-IronPort-AV: E=Sophos;i="5.91,284,1647327600"; d="scan'208";a="338333000" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.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-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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