From patchwork Tue Sep 26 06:06:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 13398703 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 20837E7D0C5 for ; Tue, 26 Sep 2023 06:06:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AF5D8D0060; Tue, 26 Sep 2023 02:06:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 860868D0005; Tue, 26 Sep 2023 02:06:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 727698D0060; Tue, 26 Sep 2023 02:06:47 -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 60A7C8D0005 for ; Tue, 26 Sep 2023 02:06:47 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2FBDF160EB4 for ; Tue, 26 Sep 2023 06:06:47 +0000 (UTC) X-FDA: 81277714854.15.6E97A5D Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by imf12.hostedemail.com (Postfix) with ESMTP id D714D40004 for ; Tue, 26 Sep 2023 06:06:44 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HJ3oklWs; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695708405; a=rsa-sha256; cv=none; b=nb2Wh9O3w3QVkhChmL8VdVk85wOU2gCDvu4xRPZbHBv63Hr+HNTTLJaQnrsfh6qDFKNC4P KigU+DbXjqB1hUEoipvIiIe/0Wq9RugO4GJx5u4wUXMGSgv6hyqfnc6NL7h6rzLstI7Ib2 eQeCoW94+luK+FqnfBHIndEKw3LWWJQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HJ3oklWs; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695708405; 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=lTIzIq+dp72zyMzsPEMEEWGj8GJtma9KYFZE3ytnOBU=; b=npvhK3MEMtFW0g5VyR9ZFmVghoKpsVsvSfE+ijK8+WIFgaOVIMM3BflGSXahXPhznpEBlu xYoweYPlLGcuefcwrEskNM9X1/K7hdrFSCdScA60TVE7+iWm2431h+2OfT2KGF/pPdvkcj V/9orCSpC3n38hpZ12fGlEmubrBZ4PA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695708404; x=1727244404; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BTeQjxFqqPQbTYtnjfB/3At0ooEzs++Phg1kXxCT1Pw=; b=HJ3oklWsyW7FMdx2BSPvCMhysUO0OuEvxqB/am84VjlZkWayG8QVIt6z GVliEIDF9wrVGzNg5IEBL9XpTZRSMCwMm7owNJkvMTBJvC2OwKNf4Uobi nL97MNcr/ZawSGKaHC2QUAnxbK446VfsDC9uFB/0tInONrUHr7RabLjcc Dx+cXVRfpxzup4D337GVxkc8bS6UWDLgoLj2A6/ZFnjICqWnrBnmGPwEv Azicq8J5QuC4SSBV5B5C1QmjtWGgrQ/8B9xJIg83LlblJPMG4Cg8xkCL2 K3ZKoD3L/nJyDPw2KEZjv+CKoqKysz3ao4FPZkhp/R/3/Ns9w/SSl+Plr Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="447990796" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="447990796" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 23:06:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="892074766" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="892074766" Received: from aozhu-mobl.ccr.corp.intel.com (HELO yhuang6-mobl2.ccr.corp.intel.com) ([10.255.31.94]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 23:05:33 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Bharata B Rao , Alistair Popple , Dave Jiang , "Aneesh Kumar K . V" , Wei Xu , Dan Williams , Dave Hansen , Davidlohr Bueso , Johannes Weiner , Jonathan Cameron , Michal Hocko , Yang Shi , Rafael J Wysocki Subject: [PATCH -V4 0/4] memory tiering: calculate abstract distance based on ACPI HMAT Date: Tue, 26 Sep 2023 14:06:24 +0800 Message-Id: <20230926060628.265989-1-ying.huang@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D714D40004 X-Stat-Signature: j91s87y6yheuizjcgq6fzskyz946n7cy X-HE-Tag: 1695708404-309608 X-HE-Meta: U2FsdGVkX18itBOC2GuC+XHGn+J7ArpCH675esHu7Rl4oJfDDGLM/CDj1JbYLBf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=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: v4: - Fix and optimize the error processing. Thanks Alistair's comments! - Collected reviewed-by. 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