Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2629755ioo; Sat, 28 May 2022 21:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5xEYS95hju1Y6ducLaIO05olAG2kwSzUbP9aDkYx1S/A5Kp2rCg/EWHVfB3SvMgCZTJoh X-Received: by 2002:a63:2209:0:b0:3ab:113b:9a2b with SMTP id i9-20020a632209000000b003ab113b9a2bmr44117983pgi.235.1653798709514; Sat, 28 May 2022 21:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653798709; cv=none; d=google.com; s=arc-20160816; b=vAZNE+8Ca9LQu+FVgvZCflN2TKqbbTAEu4tJ5zs7kFA462UCpNtNb16qU39udsYVuJ F26/KrVHw2bUKAFIsvzC59W726MyzHDVrmZ7hy+VYAZtTvotUuF1Cypv7NqgLbypuGiy 5V9AYYzJgNz0RO8Yhc9Jj1+EGukScr5hfDXT8FGW5H4tOcDOPlttvRt+m9RpRjl/RejW e0b+8pDr+eiugcipr0HbZsiWT7MT4kh0GSMuOX7NzkECI6wo6GmQEvXer0sGTbrnE4Y2 +DbD9MzVDZHoCoW6dfEyeOwtP9i0UvcPTk6jHFYoHXlouosFxu4sg87TuhFsefWyTmbK zQCw== 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=J+b2FmQiuKrbLUzSg2+RHfdTzbcRmRPI82ZD5I0TKOc=; b=h0gGKYu2G6B8OGA8HFuHyDT7hhEhw7tQW0nnC2b5BJxD04QIfNQhcPnPn30ceEvJYD MNHXZBqdwb7MjrcLcib8KFiaD+H7z1D9oim2FYaeGbpugulOHCl51EdWHtR/rb6RW0rp sT64493X66Focxv4xsfPpM3no8zMfEf7GGRglJYLGKvFoS7Gzqx5PBJLDYOUVCYTehkk qd2ZiTZCjGxsLhvApunxwDWloGJUA9bugl3lwsxyIHpB45RzlvyTgQ7FS9iCxDpH++54 MTwwhzcgIScUajblTC58tAMRYWc/ajVgY1vV6n8FMIXTzThg7GoabFfzCDHxnxRoCPES XWcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="C81V/xhQ"; 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 q6-20020a170902f78600b0015f0bce1a31si6196546pln.558.2022.05.28.21.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 21:31:49 -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="C81V/xhQ"; 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 7364250B23; Sat, 28 May 2022 21:31:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230345AbiE2Ebl (ORCPT + 99 others); Sun, 29 May 2022 00:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbiE2Ebk (ORCPT ); Sun, 29 May 2022 00:31:40 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF570506D5 for ; Sat, 28 May 2022 21:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653798698; x=1685334698; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=t3c/Rw6oHrKkRAWVQS+d6BYwqueqvTGSN0tvGDscmAY=; b=C81V/xhQOfUN74cr3mOy2MsChnz0nsp+HXHFnsq5wSm4bn7nM+xuJ90c f8QaXn7OiQV+8RzSOZetPMivwhkn0skuuBpMXjgz2PTXahu5C8AOC75Az J0RbxkVVFMfGArSzsz3btUFk3nvRUPm8kLWdQVRXMeSWwyfasyPxI90j5 S6sm+xOdPpkZf5pJryirBqHg4ffsooQjHLnqFnOh9NggUuBnrkatAZV+I LJMLiKTNrAqBHaPH35tlHfcw8YdB0hwLyu6l1pln5rm2UOgFTlXLTBSr6 eLp8DJGTTufVcnceRFbPg8Wskq+Qy+NcdO5iVdjyC9G5qTCB3V5aPPzsS A==; X-IronPort-AV: E=McAfee;i="6400,9594,10361"; a="254624049" X-IronPort-AV: E=Sophos;i="5.91,260,1647327600"; d="scan'208";a="254624049" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2022 21:31:38 -0700 X-IronPort-AV: E=Sophos;i="5.91,260,1647327600"; d="scan'208";a="604627739" Received: from lli111-mobl.ccr.corp.intel.com ([10.254.214.246]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2022 21:31:33 -0700 Message-ID: <1281d918c07b05ac82aee290018ad08d212e0aaa.camel@intel.com> Subject: Re: RFC: Memory Tiering Kernel Interfaces (v3) From: Ying Huang To: Wei Xu , Aneesh Kumar K V Cc: Andrew Morton , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Linux MM , Jagdish Gediya , Baolin Wang , David Rientjes Date: Sun, 29 May 2022 12:31:30 +0800 In-Reply-To: References: 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.8 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 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. Best Regards, Huang, Ying