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 574A3ECAAD2 for ; Fri, 26 Aug 2022 08:06:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B685E940008; Fri, 26 Aug 2022 04:06:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1879940007; Fri, 26 Aug 2022 04:06:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B8FD940008; Fri, 26 Aug 2022 04:06:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8E02C940007 for ; Fri, 26 Aug 2022 04:06:27 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 52DAF1A051A for ; Fri, 26 Aug 2022 08:06:27 +0000 (UTC) X-FDA: 79841011614.26.6E5464F Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf18.hostedemail.com (Postfix) with ESMTP id 9CC331C0020 for ; Fri, 26 Aug 2022 08:06:26 +0000 (UTC) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27Q7qibT026387; Fri, 26 Aug 2022 08:05:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=+q+mcuZT1yCtfvoq3MQBSvgKBHU0yUIHVcNQ3mpq+bU=; b=V/vCTwqxvCTwc1Kn1DTNMXFcn/IPK8RQScj8VK70CL1u/9rBrJyRATHzPCF6e3sSILvn 1FtM8jk8F49OU+qoKiwk8Cr4ACQBxo9EtsAjffDvVOar+isIEEcCHTEYb+MwutLo6OsU tW9vgdn3aZNWakoyV/Y9whZV+duF/MD68xgRRWRjVGmhjkVWEEO6gV/XNcULCEceR2CV NBFQ/nYs95ch67gb9Ncj0KYRjhEwHZVBYXw4d6Fy8FwMMpVGs13Zqn0cGYwU+MuSCD2A NkpVAdi5PSVS4DOGjeCmG+CMWp8nDxNUtdvGp08GdoukZE0+En2QpM4bay5CfrE/Aj9Y oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j6t62gbvh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 08:05:56 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27Q7v080038655; Fri, 26 Aug 2022 08:05:55 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j6t62gbtj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 08:05:55 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27Q7pbw2003400; Fri, 26 Aug 2022 08:05:53 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04ams.nl.ibm.com with ESMTP id 3j2q88ye8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 08:05:53 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27Q85p7E35783036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Aug 2022 08:05:51 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39C84A4053; Fri, 26 Aug 2022 08:05:51 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE272A4040; Fri, 26 Aug 2022 08:05:45 +0000 (GMT) Received: from [9.43.10.139] (unknown [9.43.10.139]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 26 Aug 2022 08:05:45 +0000 (GMT) Message-ID: <4abb84e8-8035-65aa-941a-98f0d7902c42@linux.ibm.com> Date: Fri, 26 Aug 2022 13:35:44 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [RFC PATCH 1/2] mm/demotion: Expose memory type details via sysfs Content-Language: en-US To: Wei Xu Cc: "Huang, Ying" , 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 , Johannes Weiner , jvgediya.oss@gmail.com, Bharata B Rao References: <20220825092325.381517-1-aneesh.kumar@linux.ibm.com> <877d2v3h8s.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Aneesh Kumar K V In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: f5uYDCTq5rIu0455lEF1GcIUMLo4MQoc X-Proofpoint-ORIG-GUID: JPItfWiSpSd6K9jtVpalgu9qdigvGpiO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-26_03,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208260029 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661501186; a=rsa-sha256; cv=none; b=qVYe5olX8WfHp+1QxZCTTY+amnptkGVbemghBtmbxp6IqjWXDcyfjWNciwSPfpiP2KtPqb XMg+iYIWzAzY6lU5ihbXa860kKenp0h76DVgqBXFQcGmMzoHjLwh0x5/9aCYMIkCsEhett /P7pnQQ4plw3uMlcDO5ByYFf7n9oGeA= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="V/vCTwqx"; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661501186; 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=+q+mcuZT1yCtfvoq3MQBSvgKBHU0yUIHVcNQ3mpq+bU=; b=dtSmi3hw8xIYWhUmGfD1IOvMbFI6wf3Y2DU1nxZOzy9flvreq20tlRUJBpbsbX0QLYKAva ksQdgdS23WYymRmPC9Hk2iI8W2VP8INacTqKyp8oOSQRbs/0o1x6ecePOeDvRmyDT2Sjx1 lR71e7ArSdTltjwE2y5X91gVIwl16qA= Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="V/vCTwqx"; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com X-Rspam-User: X-Rspamd-Queue-Id: 9CC331C0020 X-Rspamd-Server: rspam08 X-Stat-Signature: 6eksyq4fiuyoxcsjc8ocpa99xpbpk6pu X-HE-Tag: 1661501186-31640 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: On 8/26/22 1:30 PM, Wei Xu wrote: > On Thu, Aug 25, 2022 at 8:00 PM Aneesh Kumar K V > wrote: >> >> On 8/26/22 7:20 AM, Huang, Ying wrote: >>> "Aneesh Kumar K.V" writes: >>> >>>> This patch adds /sys/devices/virtual/memtier/ where all memory tier related >>>> 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 >>> >> >> subsys_system_register() documentation says >> >> * Do not use this interface for anything new, it exists for compatibility >> * with bad ideas only. New subsystems should use plain subsystems; and >> * add the subsystem-wide attributes should be added to the subsystem >> * directory itself and not some create fake root-device placed in >> * /sys/devices/system/. >> >> memtier being a virtual device, I was under the impression that /sys/devices/virtual >> is the recommended place. >> >>> 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". >>> >> >> I was looking consolidating both memory tier and memory type into the same sysfs subsystem. >> Your recommendation imply we create two subsystem memory_tier and memtype. I was >> trying to avoid that. May be a generic term like "memory_tiering" can help to >> consolidate all tiering related details there? >> > > A generic term "memory_tiering" sounds good to me. > > Given that this will be a user-facing, stable kernel API, I think we'd > better to only add what is most useful for userspace and don't have to > mirror the kernel internal data structures in this interface. > > My understanding is that we haven't fully settled down on how to > customize memory tiers from userspace. So we don't have to show > memory_type yet, which is a kernel data structure at this point. > > The userspace does need to know what are the memory tiers and which > NUMA nodes are included in each memory tier. How about we provide the > "nodelist" interface for each memory tier as in the original proposal? > > The userspace would also like to know which memory tiers/nodes belong > to the top tiers (the promotion targets). We can provide a "toptiers" > or "toptiers_nodelist" interface to report that. > How about also including abstract distance range of a memory tier? That will be useful to derive the hierarchy. > Both should still be useful even if we decide to add memory_type for > memory tier customization. > -aneesh