Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1654491rwe; Fri, 2 Sep 2022 01:09:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vhTriurUkCWCwtKUefnYSlTyMOA58JgfWhLt6I1Xy0TQ4RbYQC57/xNp1ePToLuD7rnhi X-Received: by 2002:a17:906:db05:b0:741:5730:270e with SMTP id xj5-20020a170906db0500b007415730270emr18487987ejb.609.1662106148406; Fri, 02 Sep 2022 01:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662106148; cv=none; d=google.com; s=arc-20160816; b=rzau/yGzpn+5+CXgK2UQrgDSeBSvNbZTpoKkUlSKwPJceHvIhSt4Lv+OHw+HmmO+WP ndFJl0KAB5BbkhenoSONHaK7hLQsHPJFfSfSJPEsjdRAOVEVw13pRdSjM+vchDMlE92Z udP86kZOZgPC6G/LWj6e6VmhfUnMnrMs6KgHw2ghvvb1oz3aT0eSULP7uzcKPm3ZuJqz lKZ+DSWaoj9y+UcXwOtlwGzUTqaTBVCLvPT0O/bxqYpKe4lqcczkKsHcdtoZtnB6NQLe r8iko3GfUkuWYHKoqLNvAxONMWTkwm4LnR8my7EKrQ0lWW3c8+F4yPFczKrsbC0JkahG urog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=NbzGEJGTLFMuXO9XSvdyYKCCaUgqZ9m/bPSjE/6xFXk=; b=Dus5QkTJ67s9apAtWmj6z8ZBqie/v9r7nOg0P+6WgoNohuoKhRrMIcl0bCFvgx29LT OD11Z6bgj+M6s0YE93vw90sYY9zdvJ20ZOKP6dbj1y+8+GP2TUVAKJXDD93gUToCIrkk Joew4sBMw0bTnRzmGzAI2yX7b9uKrj/csVVOxUfjtYt+AAVclE1827rBfKiZKchWD8xV or3sCU2FZwNkfqGXs/Tq9l++PJB51taBmITafh0ARfGPM1ksivXrPysX9NM2JsMi5xPp bfY3HRc/sM/QUtfyE7gC+OAWJmE2jqhqZHi3n+zxAl/rQTZIAOrlLI5fAzmc46hJCcxc oIZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cQpgePs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg17-20020a170907a41100b0072ae61935afsi967461ejc.304.2022.09.02.01.08.43; Fri, 02 Sep 2022 01:09:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cQpgePs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235580AbiIBH61 (ORCPT + 99 others); Fri, 2 Sep 2022 03:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235608AbiIBH6P (ORCPT ); Fri, 2 Sep 2022 03:58:15 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D82A3BD164 for ; Fri, 2 Sep 2022 00:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662105488; x=1693641488; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=U+sckmWxu/dh7LzjzffyvQqItsRKsl7L7Kdq5ogbtnY=; b=cQpgePs6DjCrtKVvKbsaFfqR/9OSObLdjwDxXeZSvvnKVp5QqJI2tjeA dlZIRmeTdcyaZh27Hz2zubx0QKpmTcgliW5C2RGlKTWqunVCFVlUq5E1B KhsS8sT2s/eqZ1ogERWZQwtdQ3yvqqW1hrfY/vktgVM3PjoZY1FhWc/bC PTCz4AhDtICNNZ6o7UXLLG0kCzyclllj7fPGsW3Lpi7dz0HwfTfOA5PiN FlP3LZRf6PkrNhM5jM4XwyFIwNupnFFxUgo/vakd32IkS7g5wKQuqs4Nv Wa5O8KPn7f+07cw2lhEc9kj5ZtuZpz3m+WYeTrn3bvUqVb3cWBtOI+7JE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="276328292" X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="276328292" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2022 00:58:07 -0700 X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="589983425" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2022 00:58:02 -0700 From: "Huang, Ying" To: Wei Xu , Aneesh Kumar K V , Johannes Weiner Cc: Linux MM , Andrew Morton , Yang Shi , Davidlohr Bueso , Tim C Chen , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , jvgediya.oss@gmail.com, Bharata B Rao , Greg Thelen , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH v3 updated] mm/demotion: Expose memory tier details via sysfs In-Reply-To: (Wei Xu's message of "Fri, 2 Sep 2022 00:02:05 -0700") References: <20220830081736.119281-1-aneesh.kumar@linux.ibm.com> <87tu5rzigc.fsf@yhuang6-desk2.ccr.corp.intel.com> <87pmgezkhp.fsf@yhuang6-desk2.ccr.corp.intel.com> <87fshaz63h.fsf@yhuang6-desk2.ccr.corp.intel.com> <698120ce-d4df-3d13-dea9-a8f5c298783c@linux.ibm.com> <87bkryz4nh.fsf@yhuang6-desk2.ccr.corp.intel.com> <2b4ddc45-74ae-27df-d973-6724f61f4e18@linux.ibm.com> <877d2mz3c1.fsf@yhuang6-desk2.ccr.corp.intel.com> <45488760-02b5-115b-c16d-5219303f2f33@linux.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Fri, 02 Sep 2022 15:57:53 +0800 Message-ID: <871qsuyzr2.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wei Xu writes: > On Thu, Sep 1, 2022 at 11:44 PM Aneesh Kumar K V > wrote: >> >> On 9/2/22 12:10 PM, Huang, Ying wrote: >> > Aneesh Kumar K V writes: >> > >> >> On 9/2/22 11:42 AM, Huang, Ying wrote: >> >>> Aneesh Kumar K V writes: >> >>> >> >>>> On 9/2/22 11:10 AM, Huang, Ying wrote: >> >>>>> Aneesh Kumar K V writes: >> >>>>> >> >>>>>> On 9/2/22 10:39 AM, Wei Xu wrote: >> >>>>>>> On Thu, Sep 1, 2022 at 5:33 PM Huang, Ying wrote: >> >>>>>>>> >> >>>>>>>> Aneesh Kumar K V writes: >> >>>>>>>> >> >>>>>>>>> On 9/1/22 12:31 PM, Huang, Ying wrote: >> >>>>>>>>>> "Aneesh Kumar K.V" writes: >> >>>>>>>>>> >> >>>>>>>>>>> This patch adds /sys/devices/virtual/memory_tiering/ where all memory tier >> >>>>>>>>>>> related details can be found. All allocated memory tiers will be listed >> >>>>>>>>>>> there as /sys/devices/virtual/memory_tiering/memory_tierN/ >> >>>>>>>>>>> >> >>>>>>>>>>> The nodes which are part of a specific memory tier can be listed via >> >>>>>>>>>>> /sys/devices/virtual/memory_tiering/memory_tierN/nodes >> >>>>>>>>>> >> >>>>>>>>>> I think "memory_tier" is a better subsystem/bus name than >> >>>>>>>>>> memory_tiering. Because we have a set of memory_tierN devices inside. >> >>>>>>>>>> "memory_tier" sounds more natural. I know this is subjective, just my >> >>>>>>>>>> preference. >> >>>>>>>>>> >> >>>>>> >> >>>>>> >> >>>>>> I missed replying to this earlier. I will keep memory_tiering as subsystem name in v4 >> >>>>>> because we would want it to a susbsystem where all memory tiering related details can be found >> >>>>>> including memory type in the future. This is as per discussion >> >>>>>> >> >>>>>> https://lore.kernel.org/linux-mm/CAAPL-u9TKbHGztAF=r-io3gkX7gorUunS2UfstudCWuihrA=0g@mail.gmail.com >> >>>>> >> >>>>> I don't think that it's a good idea to mix 2 types of devices in one >> >>>>> subsystem (bus). If my understanding were correct, that breaks the >> >>>>> driver core convention. >> >>>>> >> >>>> >> >>>> All these are virtual devices .I am not sure i follow what you mean by 2 types of devices. >> >>>> memory_tiering is a subsystem that represents all the details w.r.t memory tiering. It shows >> >>>> details of memory tiers and can possibly contain details of different memory types . >> >>> >> >>> IMHO, memory_tier and memory_type are 2 kind of devices. They have >> >>> almost totally different attributes (sysfs file). So, we should create >> >>> 2 buses for them. Each has its own attribute group. "virtual" itself >> >>> isn't a subsystem. >> >> >> >> Considering both the details are related to memory tiering, wouldn't it be much simpler we consolidate >> >> them within the same subdirectory? I am still not clear why you are suggesting they need to be in different >> >> sysfs hierarchy. It doesn't break any driver core convention as you mentioned earlier. >> >> >> >> /sys/devices/virtual/memory_tiering/memory_tierN >> >> /sys/devices/virtual/memory_tiering/memory_typeN >> > >> > I think we should add >> > >> > /sys/devices/virtual/memory_tier/memory_tierN >> > /sys/devices/virtual/memory_type/memory_typeN >> > >> >> I am trying to find if there is a technical reason to do the same? >> >> > I don't think this is complex. Devices of same bus/subsystem should >> > have mostly same attributes. This is my understanding of driver core >> > convention. >> > >> >> I was not looking at this from code complexity point. Instead of having multiple directories >> with details w.r.t memory tiering, I was looking at consolidating the details >> within the directory /sys/devices/virtual/memory_tiering. (similar to all virtual devices >> are consolidated within /sys/devics/virtual/). >> >> -aneesh > > Here is an example of /sys/bus/nd/devices (I know it is not under > /sys/devices/virtual, but it can still serve as a reference): > > ls -1 /sys/bus/nd/devices > > namespace2.0 > namespace3.0 > ndbus0 > nmem0 > nmem1 > region0 > region1 > region2 > region3 > > So I think it is not unreasonable if we want to group memory tiering > related interfaces within a single top directory. Thanks for pointing this out. My original understanding of driver core isn't correct. But I still think it's better to separate instead of mixing memory_tier and memory_type. Per my understanding, memory_type shows information (abstract distance, latency, bandwidth, etc.) of memory types (and nodes), it can be useful even without memory tiers. That is, memory types describes the physical characteristics, while memory tier reflects the policy. Just my 2 cents. Best Regards, Huang, Ying