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 93B32C00144 for ; Fri, 29 Jul 2022 07:24:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2A0B6B0071; Fri, 29 Jul 2022 03:24:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED8F18E0002; Fri, 29 Jul 2022 03:24:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA1218E0001; Fri, 29 Jul 2022 03:24:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CAAD96B0071 for ; Fri, 29 Jul 2022 03:24:55 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9B0EFA165B for ; Fri, 29 Jul 2022 07:24:55 +0000 (UTC) X-FDA: 79739300550.07.F7D6437 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf02.hostedemail.com (Postfix) with ESMTP id 1960F8008F for ; Fri, 29 Jul 2022 07:24:54 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26T7BlZd010632; Fri, 29 Jul 2022 07:24:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : content-type : mime-version; s=pp1; bh=aQUH8yXw5a0UzXZ9f/Q9Y4GT7vvRL0B1syGLYI6jQfU=; b=pHXmbSuAxobnovzNzEzO3oyelos/x/3dP3fD1Id7/ZtUFFmtgHhHGZ7JsRxXcSmPiveX 66O/EAqSMdeWRPLqXHdaGZkct55A+e1/O5+edFvbyYxD3AAsT8A59qEGsF26y/Oqoeny LLcwtOEBfRO+D0/YvqVFH3Xnm/6tMk3+VCFPS/PzQbAzOdXe3/W5G9FnHka33emtQ4iI ctlSMau/habVHJyppsFVjGklwLhOK/VFSWW7aGNRU07LfHCeN4cU5vUf/3xK03DFA6D1 aCR1qcBy+DZFIPhRvBMvR6/03MtcLd296TcsNgGfQgSSs+3ewAfnuoY7FdD7VVmRMzrY oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hmaxrrc45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Jul 2022 07:24:48 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 26T7H94k003368; Fri, 29 Jul 2022 07:24:47 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hmaxrrc3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Jul 2022 07:24:47 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26T7Jp7K001625; Fri, 29 Jul 2022 07:24:46 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 3hg97956qh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Jul 2022 07:24:46 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26T7OjsH36700418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jul 2022 07:24:45 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B7E27805C; Fri, 29 Jul 2022 07:24:45 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 340827805E; Fri, 29 Jul 2022 07:24:39 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.43.86.244]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 29 Jul 2022 07:24:38 +0000 (GMT) X-Mailer: emacs 29.0.50 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: "Huang, Ying" 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, Jagdish Gediya Subject: Re: [PATCH v11 1/8] mm/demotion: Add support for explicit memory tiers In-Reply-To: <871qu4mo5a.fsf@yhuang6-desk2.ccr.corp.intel.com> References: <20220728190436.858458-1-aneesh.kumar@linux.ibm.com> <20220728190436.858458-2-aneesh.kumar@linux.ibm.com> <871qu4mo5a.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Fri, 29 Jul 2022 12:54:36 +0530 Message-ID: <874jz0s7nv.fsf@linux.ibm.com> Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: iiamhCuVrxw7GzooEdNlkk-c22qPeiw3 X-Proofpoint-ORIG-GUID: yhiX8T0S1i1p0qHGIYFx4hf5bp1OXMrZ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-28_06,2022-07-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 priorityscore=1501 adultscore=0 mlxscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207290028 ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pHXmbSuA; spf=pass (imf02.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659079495; a=rsa-sha256; cv=none; b=DOPwG/6aKLPaiw2JIJ/rDJMyBNy2uWf8kQPOBCpi++PX8PvXuIu+eDLQ6zMbpkwefsPUC5 3IvI5og/A4wiTtSsnitVKFscpgSmZd/cbR1r+mTTjmOSBCivB9cytqNe/eBkhuMJAZPzDm 5s2aFGmz3TNpIHmVbRA+ZZSOKykjVus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659079495; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aQUH8yXw5a0UzXZ9f/Q9Y4GT7vvRL0B1syGLYI6jQfU=; b=ca+ftw2XODwh9RQ/R76xnrXG8DSkStIr8znx+O+VAtIURnbM+Od8lImagin41JsRkJ/uaF dEjbMC9shEQkKW8da8bvfIwNwvJDvPTwzZcLSBRnUjikd38mmDRwOVKrPnmtV/Fr6VSVy4 k0Gz7QWS9t1hOhle2z7YM/p8io5Ru5c= X-Stat-Signature: bd65aejefx58o8iqjrttxr63frekd7ub X-Rspamd-Queue-Id: 1960F8008F X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pHXmbSuA; spf=pass (imf02.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: rspam02 X-HE-Tag: 1659079494-965809 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: "Huang, Ying" writes: > "Aneesh Kumar K.V" writes: > >> In the current kernel, memory tiers are defined implicitly via a demotion path >> relationship between NUMA nodes, which is created during the kernel >> initialization and updated when a NUMA node is hot-added or hot-removed. The >> current implementation puts all nodes with CPU into the highest tier, and builds >> the tier hierarchy tier-by-tier by establishing the per-node demotion targets >> based on the distances between nodes. >> >> This current memory tier kernel implementation needs to be improved for several >> important use cases, >> >> The current tier initialization code always initializes each memory-only NUMA >> node into a lower tier. But a memory-only NUMA node may have a high performance >> memory device (e.g. a DRAM-backed memory-only node on a virtual machine) that >> should be put into a higher tier. >> >> The current tier hierarchy always puts CPU nodes into the top tier. But on a >> system with HBM or GPU devices, the memory-only NUMA nodes mapping these devices >> should be in the top tier, and DRAM nodes with CPUs are better to be placed into >> the next lower tier. >> >> With current kernel higher tier node can only be demoted to nodes with shortest >> distance on the next lower tier as defined by the demotion path, not any other >> node from any lower tier. This strict, demotion order does not work in all use >> cases (e.g. some use cases may want to allow cross-socket demotion to another >> node in the same demotion tier as a fallback when the preferred demotion node is >> out of space), This demotion order is also inconsistent with the page allocation >> fallback order when all the nodes in a higher tier are out of space: The page >> allocation can fall back to any node from any lower tier, whereas the demotion >> order doesn't allow that. >> >> This patch series address the above by defining memory tiers explicitly. >> >> Linux kernel presents memory devices as NUMA nodes and each memory device is of >> a specific type. The memory type of a device is represented by its abstract >> distance. A memory tier corresponds to a range of abstract distance. This allows >> for classifying memory devices with a specific performance range into a memory >> tier. >> >> This patch configures the range/chunk size to be 128. The default DRAM >> abstract distance is 512. We can have 4 memory tiers below the default DRAM >> abstract distance which cover the range 0 - 127, 127 - 255, 256- 383, 384 - 511. >> Slower memory devices like persistent memory will have abstract distance below >> the default DRAM level and hence will be placed in these 4 lower tiers. > > For abstract distance, the lower value means higher performance, higher > value means lower performance. So the abstract distance of PMEM should > be smaller than that of DRAM. I noticed that after sending v11 and did send v12 fixing that already which can be found https://lore.kernel.org/linux-mm/20220729061349.968148-1-aneesh.kumar@linux.ibm.com > >> A kernel parameter is provided to override the default memory tier. > > Forget to delete? yes. Also fixed in v12. -aneesh