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 BDBB4ECAAD3 for ; Thu, 1 Sep 2022 08:25:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 294AD8D0001; Thu, 1 Sep 2022 04:25:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 244856B0073; Thu, 1 Sep 2022 04:25:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10D278D0001; Thu, 1 Sep 2022 04:25:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 012DC6B0072 for ; Thu, 1 Sep 2022 04:25:03 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CBB4CABCC6 for ; Thu, 1 Sep 2022 08:25:03 +0000 (UTC) X-FDA: 79862831286.21.F5CDB7A Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf30.hostedemail.com (Postfix) with ESMTP id 220BE8005E for ; Thu, 1 Sep 2022 08:25:02 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2818JBeD015615; Thu, 1 Sep 2022 08:24:40 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=12GUrv4vvXe7jwapZkfA7+yEjOTGAKm7DPYsXi7d3KM=; b=BUcmxVda72Hp/7IDVzcU1Y+31hciCqJ7iS+C0YHqdxqsBeVe+HimHMhx8HasHPAZaa6k 17cZvQIOTIPJLDB75Uj01gz33FBRvB7jFK1EFhNHIMzudGJ/zA7mce8O0EsVmkUJZSly vyElriHx1VCIzUXmKPgq+PwpWLAUAMdH7eHdKXD4GToLxFacg3sEIvraEFFGds+JjTDH OX/ec3fGDK8pYstqQGFRN0BLdSnBYBQds+arvTgYdn6BO2XhUmRm4WYwUsS4OVqSLw6y xVmmdwtg4fbtB/oZ/rPWrUYd6S5QKZ0JmhSBzWusCATG75f1RubpLrE1mCNdyJ/GJTxT 8g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jas4f85fs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 08:24:40 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2818KJIT023073; Thu, 1 Sep 2022 08:24:39 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jas4f85es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 08:24:39 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2818O3vR020359; Thu, 1 Sep 2022 08:24:36 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3j8hkabh5k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 08:24:36 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2818OYMM39387446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Sep 2022 08:24:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B9BD4C046; Thu, 1 Sep 2022 08:24:34 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4BA074C040; Thu, 1 Sep 2022 08:24:29 +0000 (GMT) Received: from [9.43.54.15] (unknown [9.43.54.15]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 1 Sep 2022 08:24:28 +0000 (GMT) Message-ID: Date: Thu, 1 Sep 2022 13:54:27 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v3 updated] mm/demotion: Expose memory tier details via sysfs Content-Language: en-US To: "Huang, Ying" , Wei Xu , Johannes Weiner Cc: linux-mm@kvack.org, akpm@linux-foundation.org, 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 References: <20220830081736.119281-1-aneesh.kumar@linux.ibm.com> <87tu5rzigc.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Aneesh Kumar K V In-Reply-To: <87tu5rzigc.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fHTVUoM07mWdeuusB4DYRMmvY3608yis X-Proofpoint-ORIG-GUID: EnqFTL9SonUP_POiu2Hq90rLbkEIPfO4 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-09-01_05,2022-08-31_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209010035 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662020703; a=rsa-sha256; cv=none; b=unh44RjIksCt76H6EF3JJNh2lsd58Y2G0rpGwlMLWkXOUnlA85K8SBqdGAPB1PMk8Ury+v zWyK/i2wEYiUGx9K2yEqNdJ6bmFp5wEJ0JncvMw0KmqOG0UoTIJvQUYPN3aufBBOPKyrdV 7y8rJQNGkp6oqidhT3H7F0ir1wpr2VA= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BUcmxVda; spf=pass (imf30.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662020703; 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=12GUrv4vvXe7jwapZkfA7+yEjOTGAKm7DPYsXi7d3KM=; b=cEbOxSBUU2duSjxAQjHcIvCspKyOl8YuoQvsXO1zrOAX94E9jxmnp6SkXM18bImLPNC2PW QDJNyFyOOpkhblWhsXvqyVqjF/AOr3FUrRNx/6foI2diZi2EocOGj+rU/999pPihdSnxKB SycynC7Uj9BKYiouuFmkMl5Z3f4adik= X-Rspamd-Queue-Id: 220BE8005E X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BUcmxVda; spf=pass (imf30.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam03 X-Stat-Signature: 9kigryocgyg574gai1f1qmyrek1r5x45 X-HE-Tag: 1662020702-345043 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 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. > >> >> A directory hierarchy looks like >> :/sys/devices/virtual/memory_tiering$ tree memory_tier4/ >> memory_tier4/ >> ├── nodes >> ├── subsystem -> ../../../../bus/memory_tiering >> └── uevent >> >> All toptier nodes are listed via >> /sys/devices/virtual/memory_tiering/toptier_nodes >> >> :/sys/devices/virtual/memory_tiering$ cat toptier_nodes >> 0,2 >> :/sys/devices/virtual/memory_tiering$ cat memory_tier4/nodes >> 0,2 > > I don't think that it is a good idea to show toptier information in user > space interface. Because it is just a in kernel implementation > details. Now, we only promote pages from !toptier to toptier. But > there may be multiple memory tiers in toptier and !toptier, we may > change the implementation in the future. For example, we may promote > pages from DRAM to HBM in the future. > In the case you describe above and others, we will always have a list of NUMA nodes from which memory promotion is not done. /sys/devices/virtual/memory_tiering/toptier_nodes shows that list. > Do we need a way to show the default memory tier in sysfs? That is, the > memory tier that the DRAM nodes belong to. > I will hold adding that until we have support for modifying memory tier details from userspace. That is when userspace would want to know about the default memory tier. For now, the user interface is a simpler hierarchy of memory tiers, it's associated nodes and the list of nodes from which promotion is not done. -aneesh