Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4260227rwb; Tue, 16 Aug 2022 18:19:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5pab0WwTSQ+5PGl/wg6qVc1GAj7AU2Lt9Kp9KOUMMXMA+7dxweyxwg0DIq0HgPecJ9o6o/ X-Received: by 2002:aa7:cd51:0:b0:440:595d:aeed with SMTP id v17-20020aa7cd51000000b00440595daeedmr21028749edw.143.1660699150092; Tue, 16 Aug 2022 18:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660699150; cv=none; d=google.com; s=arc-20160816; b=DB8rWTS4Vw6hCGA6ir2p4i6oQOytPGm9QKdMPvEsKRXxpSpZfmTu0GyCOezLS7Rltw /b05zPGiGwh4gVBqzciYrH2tjVCemTnYo9YPsCQU/sCteMxl3KqvZ78zTsSQ4ibLVaaa brijhRyA5hqkfSiYeUKmLo/dSAk4+10OKxjMeqHrZPv87okSCRxjdrVl68Esr3rGcRNU rAp8jEC2Fjw0d6lqRrPto9FXQG2qKnGUMHE11vardPsCpdnzLBR5NydDFp9kj5DXt1Mf 591QEbw7LkwfweA2O1IdCAATJo1nWNSncquVZ5lVFj6cOj2FEUcgk3KFGEwfvPadlJaU gkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=MHiVS/JzkZE8WAFGvkxU73rOwPSxwNroaOYTLVHEoYU=; b=luopatkLq/rjE9jXGGKNsGFEfUART1VAuki4n/lZZatYLE6RuFejZow13F1Aj62940 fUNK72yB7/lBc38xsrEQ0ffuQmA/dUC4Wiuv2p176DSwyviW6hQkqFMvAOxnWQbR4ZmA rMEi80c/sxIpjeZdh/IftRuAp/O8Ve29aZxlHyEnNtImcmcrGJgC+rveNdyd2Tm2KS0d 96mM95/PBWsf++9vesa7PyFr7wafZilVQ+gnVrfTzGf1GCZ2+kXCaCaGsWyIUS6o9qR0 EAk46E070Nh92YZqyIIx6lSGLBmo91RakBRdFzhzi7CE3zMcDKS8d5FkYmHaPySn8SeM kWtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HgxK5ToI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a056402254900b0043bb7218ddasi12528122edb.279.2022.08.16.18.18.44; Tue, 16 Aug 2022 18:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HgxK5ToI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237901AbiHQBFA (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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