Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2691414rdb; Tue, 12 Sep 2023 09:12:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEm7ITiQSMF6DHb3UW4WJsE9FY9kIMdtJKkT62a/HD+ubZTqEVJYy7X6jvWDCKpRTIeZoB X-Received: by 2002:a17:903:2291:b0:1bd:da96:dc70 with SMTP id b17-20020a170903229100b001bdda96dc70mr201143plh.49.1694535164678; Tue, 12 Sep 2023 09:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694535164; cv=none; d=google.com; s=arc-20160816; b=JdHRVmDcQBtafZkN93NFg7574CGt6LSmKuTrr7Ufqqw6N83ik2Bv7ZvRkMDaR9Np9a suc4uuYtVEZFat3sKkyX58gGw7jbPZ/fOZMalymDrntsipTXze3GZ7bRTNjhm/Hx9bgy J97B49Fombl8yXZHZDmX/WOSrJeTr1nXuFMyXmuCWRoVK8VwOZ4tna+8uNc1PYsJQvjT kzxJp7fS4n4L8c0JHXGjEh86uuWR31U8uXy5i1c+fdPhkkCO1kf+5CyJqCWsEwkY8oFQ pL66pOuCTJnHKUI36LJs7LGUgV7HAuI/mdeOecHD3ZHw5kUCfPMyvyzo180nCBHpwxmI ZBDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NUy3Z83lhzkshSZBzL5QRR62d/ZUQYnsZGstHWaXhEQ=; fh=WXtDDCBQ/jor0JoeZFSZqklFNWzr4dh9FCPp2PxiePg=; b=0I87lgLxwB90dy4JjTNu3kutOkeVsjuTow3w+HtnsbsbsAKgLPhyP8HYP5rgDEB7hV w6tsAHM5w1LQbYutygIFRlxxZ6rogfx/gJtSUA6IsVdzXwBA2n5n+nzzUcITkR6lUY3f Jgs9O+bTrFSAEIcJg1O+nP0eqXgNwq/GsJ4OZ+z0VVH6cQMPmEU+0a7SRYCOi6Ly7gQH 91vf/lwVzdB6XcIao/IFJVi6p2s+cTtl4B3Evi7INEJo4y270vCdvQzNe4TLYw9zAaqh qcKku/do8w8ocX15vXz7hykTq3XAfAnUFFhV+FLfuMaPqOqHCop9Ck8dqPusCD9UgMYa hC2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZpKORljs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r11-20020a1709028bcb00b001c381bd030csi8077191plo.172.2023.09.12.09.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 09:12:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZpKORljs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A640A80787F0; Tue, 12 Sep 2023 01:21:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbjILIVb (ORCPT + 99 others); Tue, 12 Sep 2023 04:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbjILIV3 (ORCPT ); Tue, 12 Sep 2023 04:21:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D5FE6F for ; Tue, 12 Sep 2023 01:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694506885; x=1726042885; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AmELVUeBBy4RL6SU7kfC0jZI+3ejOs0GDXlThj+fPLY=; b=ZpKORljsA9gmACk6AWDx80BXNwP+DK9HPT4NRxTm3Jyno83OzNabSSRb MnQoDOnOO6RqU/Su0gi5I4FY9uN5HaOfMYCF4xhDrGZJj1oYbjpx94VUN mCCOBueLXcW/VrJ1quLcpgvzsyZCaKDoRNUtxD5bnpCquk4rKh7iuBNuj /kufZO47vLkCqueQI2s+/hDWO072ZdTAZc70hR3VMDrhjdpGA7S6MuBM+ oFKgOUOKvhoDAzvipXKmkSfTvu8tglEDR3H7aqtgFlJ6rPmu+0TfsBYRR T+P4Mam3kBK4iqxkX6ltb3MMMDM9K5uI9iAIASdFhyhlmRtXZ9qFsjzHQ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="442322950" X-IronPort-AV: E=Sophos;i="6.02,245,1688454000"; d="scan'208";a="442322950" 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:21:33 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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