Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1244343lfc; Wed, 1 Jun 2022 12:54:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs79nZttmOsn0lpfqu/xOLyJUGw0b4Gof/gXx9fjwi2jkV8oQ8pu1U3IRTn/b2FF+x1xpa X-Received: by 2002:a63:fb13:0:b0:3fc:3b53:37a9 with SMTP id o19-20020a63fb13000000b003fc3b5337a9mr908757pgh.430.1654113284402; Wed, 01 Jun 2022 12:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113284; cv=none; d=google.com; s=arc-20160816; b=uHf/7dFHsWC/hKkLMHBHyqMWOZ6nBJMMl4nBjMBOly5UB6e8RfljRZfd8FfantA/jr iDi5zrkkKrjD4Epf1xyYcj3ksplK3w1E0MubJ3PnQvOcs+py/iB+CEFMMmmO4Marmbb1 +3/mcSaBo7BVqfW0c87ft8WKsKZGZYLBsBUU1msrS1+6b4I6W/8KRP1CEpGmrPR9BXYY OdEmu2nXNn3R/EbTQwsaOG9MAzcXLwJbgkp2lEKyyl1Iv3R3Lvvk9waxHoIbAZAIQWTl xoqzSU/hG2o9bo4NfqbUC6egS3hEamOcQGEuSoTDwhV9SaUehmfyrgimrU4YXBwmtjwo /dZw== 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=8nyOmjMwt00+LntBg/gdOQFYWMSFedJKLmg2cnhrtO8=; b=ynjBn7vvMuoICOZrjrDjhq+dpJxWa0Yheb4Ka9YG9O4Nwws3doLJUMNkIuz28FlUdl s95T2cJCLfIIXKeHNkc4MwUf5zXTMWvp/Bhkfk75dKRLes6Xz3n+J2463zsZ6F2skTnk qCP5E1CmtzZ2PxsvfT1ig7dgBxvXtXOiF9EDaKitz26N9ZVyq8URbnvhZ2kNRIzj0xtG iocpkCgaXdcYE/+d1pdhqIZnRqsPO7uhWHbmXq0Y52nMQbRhDlNa524C4YNj+XV9bWKY lR496UMNIfVJF45yKhbnRXcnB0+Hr9sdG9W3wiPJa4j5DJM+mBUrl9EvKicrP4lY76KU o9JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jLUApV4v; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id h22-20020a63df56000000b003fba6a7f38esi3362375pgj.603.2022.06.01.12.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:54:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jLUApV4v; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC00420E536; Wed, 1 Jun 2022 12:16:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243449AbiEaB5d (ORCPT + 99 others); Mon, 30 May 2022 21:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbiEaB5b (ORCPT ); Mon, 30 May 2022 21:57:31 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBED24BD8 for ; Mon, 30 May 2022 18:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653962249; x=1685498249; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=ySX0o1a0NBK1KoPB58FGYm0+GQ6XT4BanItUrrpKDuo=; b=jLUApV4vzFKmaDDJsDW4inFELpYgIgOUI0mGQxlUeiEiw14Uskrafnsm tScHc+HXNrzcZOgEmw3FyPFBYv+e0gWyExTDjlvYEglaeW+O86TfSOBu0 k5rCqwNe44iI3YIFAB7erAx0GqH2tJ9WFOL3450jLPo337Q7L4JHSpU6F mbyqekMIAiuBiY2mRckFsI5U2p1HNTnIX7meKcW8CH09z7UNCnBq6Z+Gi W/fE46KxDpBPwvkTiXbUYNVD5GCobEe/BwqhSDvZRkU08T7DI9YwKtDv+ tscj3E7tXfHr/a7eHb81m+bmnXsGLAYGRFIhFBpzmbv5LCyZg+kfC1jgL w==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="273919820" X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="273919820" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.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-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: > 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 > > > > >