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 B8091ECAAA2 for ; Fri, 26 Aug 2022 01:51:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44D60940008; Thu, 25 Aug 2022 21:51:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FC64940007; Thu, 25 Aug 2022 21:51:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EAAC940008; Thu, 25 Aug 2022 21:51:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 20747940007 for ; Thu, 25 Aug 2022 21:51:08 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E79F3C0B47 for ; Fri, 26 Aug 2022 01:51:07 +0000 (UTC) X-FDA: 79840065774.29.C3F79FE Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf25.hostedemail.com (Postfix) with ESMTP id 58F88A0009 for ; Fri, 26 Aug 2022 01:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661478666; x=1693014666; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=A+vo5oKdJvtFxj1nipyEpEz7lA9nkfXY7dHnH/JK1uc=; b=FvBmLK/hq7OrN7lRudfbQB4aihyokyMrG/VQENdY5EDpiZIDoI/EpLZk wv1QTxfsuv+zh2jWwYIZfuqpMCQXoXqfftQBgbmYY/wEGNkXhmfNWDh/h 64EVmuYbUIHil7zqZO/f7aoC8tCEUREl4+Kv2+62FrP9SmNMcRUrYb/N5 tZzhaCSTZg2gUFBCi0mPkndQbG+/xDaEAsxAmL9CDEqZR4dEiRLBgK7f/ OoUr6BdKAAf6LcZGhfRdQeLX7QPF1NQkgCpwyXJfiEkDYkB/DLc5kLrFc 96g9gVqolTgYK73dxBzb3Ej+bIN+r27jg3m4mMQn+siFg4pGBP4fZ99xG Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="356116619" X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="356116619" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 18:50:50 -0700 X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="643487574" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 18:50:46 -0700 From: "Huang, Ying" To: "Aneesh Kumar K.V" Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Wei Xu , Yang Shi , Davidlohr Bueso , Tim C Chen , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Johannes Weiner , jvgediya.oss@gmail.com, Bharata B Rao Subject: Re: [RFC PATCH 1/2] mm/demotion: Expose memory type details via sysfs References: <20220825092325.381517-1-aneesh.kumar@linux.ibm.com> Date: Fri, 26 Aug 2022 09:50:43 +0800 In-Reply-To: <20220825092325.381517-1-aneesh.kumar@linux.ibm.com> (Aneesh Kumar K. V.'s message of "Thu, 25 Aug 2022 14:53:24 +0530") Message-ID: <877d2v3h8s.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="FvBmLK/h"; spf=pass (imf25.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661478667; a=rsa-sha256; cv=none; b=tuK5QQLC9WIAOthNsktOCH+aZJFdoOX3HRHwtM2k0pGYRVFzVqAFnUltKS1fL0jt0jj17w pbTrHp38OdxRMxygfNXp5uoSTPo4gpVQrmB6WPnXddtlRe9a9cBfFf9rh0c7j6gTRsN0HP nV5oR43hgZTCy8CvNWomULTx0QYR8m8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661478667; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yA94+1lfaXQdCovnLYumDHbqrKRYlU6B2AxBIWNPEzg=; b=PQ3/byVSHL4Fg/qFFjX1XRmuhJsvgmG/0cYJ0e2HOYqLB3GT9IzFc3e6DK772LFswk3f1x mtbVo7s9DTgvCAep8MiAStUg9Hn2ZRbTVePa06ra+xmI3K3ySlWL/Lq1jsKMOHy/AVOUly xEfhPqCWGBTO8phlhDSBP6TV9pPUUvQ= Authentication-Results: imf25.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="FvBmLK/h"; spf=pass (imf25.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Stat-Signature: sh1cbd37mu9be8z4ub1rwqxtncp4e6wb X-Rspamd-Queue-Id: 58F88A0009 X-Rspamd-Server: rspam04 X-HE-Tag: 1661478666-192029 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: "Aneesh Kumar K.V" writes: > This patch adds /sys/devices/virtual/memtier/ where all memory tier relat= ed > details can be found. All allocated memory types will be listed there as > /sys/devices/virtual/memtier/memtypeN/ Another choice is to make memory types and memory tiers system devices. That is, /sys/devices/system/memory_type/memory_typeN /sys/devices/system/memory_tier/memory_tierN That looks more natural to me. Because we already have "node" and "memory" devices there. Why don't you put memory types and memory tiers there? And, I think we shouldn't put "memory_type" in the "memory_tier" directory. "memory_type" isn't a part of "memory_tier". > The nodes which are part of a specific memory type can be listed via > /sys/devices/system/memtier/memtypeN/nodes. How about create links to /sys/devices/system/node/nodeN in "memory_type". But I'm OK to have "nodes" file too. > The adistance value of a specific memory type can be listed via > /sys/devices/system/memtier/memtypeN/adistance. > > A directory listing looks like: > :/sys/devices/virtual/memtier# tree memtype1 > memtype1 > =E2=94=9C=E2=94=80=E2=94=80 adistance Why not just use "abstract_distance"? This is user space interface, it's better to be intuitive. > =E2=94=9C=E2=94=80=E2=94=80 nodes > =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../bus/memtier > =E2=94=94=E2=94=80=E2=94=80 uevent > > Since we will be using struct device to expose details via sysfs, drop st= ruct > kref and use struct device for refcounting the memtype. > Best Regards, Huang, Ying