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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 016FEC25B0E for ; Wed, 17 Aug 2022 01:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238012AbiHQBFA (ORCPT ); Tue, 16 Aug 2022 21:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237509AbiHQBE6 (ORCPT ); Tue, 16 Aug 2022 21:04:58 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A1DD7C1AE for ; Tue, 16 Aug 2022 18:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660698298; x=1692234298; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=mfUla04m6g9OuMl10lBVITDIZq8OhojlyKzQdm/DDNg=; b=HgxK5ToIH3gbqf2GFZSTc2V2BwvZV9KFooBlyj1UL9DUwPKuivW9kgLP 8777qFF7WL88HIl/rZchxyNxnurPIhgY2kRP7sSnzEdvKggsVAK3LjRbC ns5mGLDUXInkCmon9IXWAGzegiNOR6FkTZwSnx7HBjuDcVy3JQ+euvg/y zw0MOgz7wmCblW/VKkVLu6NQtJY5GTjl7fQ4fxLfrjBiGdD7YwmYtOsc7 lbVpkRHnxbmRUEPx0FTefbCyVO6xzfqIoXLH2jJeiuCsZA0M1AkdrQoZF mnEgWN/+tesclCmu/HeVamQ9H0Ix69tg53As2L9RQ+K6ChHRI/DLlm/OF A==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="378660378" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="378660378" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 18:02:18 -0700 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="696581283" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 18:02:14 -0700 From: "Huang, Ying" To: Bharata B Rao Cc: huang ying , Aneesh Kumar K V , , , 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 , Subject: Re: [PATCH v14 04/10] mm/demotion/dax/kmem: Set node's abstract distance to MEMTIER_DEFAULT_DAX_ADISTANCE In-Reply-To: <57a091a5-a78f-7977-3413-11260501f8c0@amd.com> (Bharata B. Rao's message of "Tue, 16 Aug 2022 20:15:55 +0530") References: <20220812055710.357820-1-aneesh.kumar@linux.ibm.com> <20220812055710.357820-5-aneesh.kumar@linux.ibm.com> <87wnbacjsh.fsf@yhuang6-desk2.ccr.corp.intel.com> <57a091a5-a78f-7977-3413-11260501f8c0@amd.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Wed, 17 Aug 2022 09:02:04 +0800 Message-ID: <877d37d6nn.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bharata B Rao writes: > On 8/16/2022 1:56 PM, huang ying wrote: > >>>> >>>> If my understanding were correct, you are suggesting to use a kind of >>>> logarithmic mapping from latency to abstract distance? That is, >>>> >>>> abstract_distance = log2(latency) >>>> >>>> While I am suggesting to use a kind of linear mapping from latency to >>>> abstract distance. That is, >>>> >>>> abstract_distance = C * latency >>>> >>>> I think that linear mapping is easy to understand. >>>> >>>> Are there some good reasons to use logarithmic mapping? >>> >>> Also, what is the recommendation for using bandwidth measure which >>> may be available from HMAT for CXL memory? How is bandwidth going >>> to influence the abstract distance? >> >> This is a good question. >> >> Per my understanding, latency stands for idle latency by default. But >> in practice, the latency under some reasonable memory accessing >> throughput is the "real" latency. So the memory with lower bandwidth >> should have a larger abstract distance than the memory with higher >> bandwidth even if the idle latency is the same. But I don't have a >> perfect formula to combine idle latency and bandwidth into abstract >> distance. One possibility is to increase abstract distance if the >> bandwidth of the memory is much lower than that of DRAM. > > So if the firmware/platforms differ in their definition of latency and > bandwidth (like idle vs real value etc) in the firmware tables > (like HMAT), then the low level drivers (like ACPI) would have to be > aware of these and handle the conversion from latency and bw to > abstract distance correctly? One possible way to make this a little easier is that we plan to add a knob (as user space interface via sysfs) for each memory type, so that the default abstract distance can be offset. If so, at least we have way to deal with difference in firmware/platforms. Best Regards, Huang, Ying