From patchwork Tue Sep 12 08:20:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 13381035 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 22714CA0EC3 for ; Tue, 12 Sep 2023 08:21:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D9E86B00C4; Tue, 12 Sep 2023 04:21:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7898B6B00C5; Tue, 12 Sep 2023 04:21:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 678E06B00C6; Tue, 12 Sep 2023 04:21:29 -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 552E96B00C4 for ; Tue, 12 Sep 2023 04:21:29 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1D73780D5F for ; Tue, 12 Sep 2023 08:21:29 +0000 (UTC) X-FDA: 81227251098.27.EF0F41C Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by imf17.hostedemail.com (Postfix) with ESMTP id C746640007 for ; Tue, 12 Sep 2023 08:21:26 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=CtJ+eCbn; spf=pass (imf17.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694506887; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=NUy3Z83lhzkshSZBzL5QRR62d/ZUQYnsZGstHWaXhEQ=; b=UvLGAB6b+7CqjlykWCcI4ovtOPvDPTWs5EG9o/4UMez6T3wHtY6wFrGZ8BdogdGgNdQxQN YF51mJufvAZ8H7pZyNiDD2f9zNR9SK7YQCM5kCxwlVyandp5Hg1y1tH/aoAmTK/I/h9EH4 OBdzMKkyBmpfNphpvAMYAXRmzm75M8E= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=CtJ+eCbn; spf=pass (imf17.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=1694506887; a=rsa-sha256; cv=none; b=l5xkW8ATFMCoRgUHdXLPSWvQoMu63IBOQtPoSfaUQPbhgQtqdweiKoYsoWc27HvKFSJbeX uY+FQPzzS6b3q97/H2Ub77Keu0UDFpkgnuNc/Rhq3JIgohmkrEraFwKw3Zsw1LBZdN7ETs rj2ggO3iOrtqA8VlS8WNPDS2q2qfGMs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694506886; x=1726042886; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AmELVUeBBy4RL6SU7kfC0jZI+3ejOs0GDXlThj+fPLY=; b=CtJ+eCbnFUPNxn/rf90Y/erxQ7+9akDfDoEQuVjoqat7bbDVVwXI7rRS z7kNoVjf+ExhboOpC/o/EAnfMKWlOSJiXsNsqf6V8EB+ZP+HT2xkYWMao 9Qdldy8LgXOCLDPoTXZFR0eXkHKTzhL4kfrqS1pSHKIzOWUA+L/6CHUjd s7464o6gkN4RQwKAmGpd9960NWkI8N3DoyLMX8AdT3DDuODz6qvw14Gv+ bY6Dcl0FGgqSHGTOMGoG2DCcyhkxjSH5eN3TVuLwdd8xbd2CUds9YUeJ0 Y88WsyE8mRcJiPB3c6TOVZIMs+KCK7ifMNtP+hj7yhoNh4N63IESHBOx4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="442322957" X-IronPort-AV: E=Sophos;i="6.02,245,1688454000"; d="scan'208";a="442322957" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 01:21:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="746787588" X-IronPort-AV: E=Sophos;i="6.02,245,1688454000"; d="scan'208";a="746787588" Received: from shicha9x-mobl.ccr.corp.intel.com (HELO yhuang6-mobl2.ccr.corp.intel.com) ([10.255.28.213]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 01:21:18 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , "Aneesh Kumar K . V" , Wei Xu , Alistair Popple , Dan Williams , Dave Hansen , Davidlohr Bueso , Johannes Weiner , Jonathan Cameron , Michal Hocko , Yang Shi , Dave Jiang , Rafael J Wysocki Subject: [PATCH -V3 0/4] memory tiering: calculate abstract distance based on ACPI HMAT Date: Tue, 12 Sep 2023 16:20:57 +0800 Message-Id: <20230912082101.342002-1-ying.huang@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: C746640007 X-Rspam-User: X-Stat-Signature: jtefzmibysu78ngzdequn98bhd9nytyg X-Rspamd-Server: rspam01 X-HE-Tag: 1694506886-767912 X-HE-Meta: U2FsdGVkX1+LDd8F3Wl/uyRbiJ2VDqt6GXC4+gx2Qh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: 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: We have the explicit memory tiers framework to manage systems with multiple types of memory, e.g., DRAM in DIMM slots and CXL memory devices. Where, same kind of memory devices will be grouped into memory types, then put into memory tiers. To describe the performance of a memory type, abstract distance is defined. Which is in direct proportion to the memory latency and inversely proportional to the memory bandwidth. To keep the code as simple as possible, fixed abstract distance is used in dax/kmem to describe slow memory such as Optane DCPMM. To support more memory types, in this series, we added the abstract distance calculation algorithm management mechanism, provided a algorithm implementation based on ACPI HMAT, and used the general abstract distance calculation interface in dax/kmem driver. So, dax/kmem can support HBM (high bandwidth memory) in addition to the original Optane DCPMM. Changelog: v3: - Move algorithm to calculate abstract distance from read/write latency/bandwidth from hmat.c to memory-ters.c per Alistair's comments. - Fix memory types putting in kmem.c for error path. V2: - Fix a typo in 4/4. - Collected reviewed-by and tested-by. V1 (from RFC): - Added some comments per Aneesh's comments, Thanks! Best Regards, Huang, Ying