Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4152099rwo; Tue, 25 Jul 2023 01:07:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlF9b8nKf+CDBwvzjZKBPGdZaZcSXDctWaXwlq5+poewkEcHcQpYjfC6EVZI0HR7a1D/zbLs X-Received: by 2002:a50:ef12:0:b0:522:296f:9082 with SMTP id m18-20020a50ef12000000b00522296f9082mr5994776eds.10.1690272456442; Tue, 25 Jul 2023 01:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690272456; cv=none; d=google.com; s=arc-20160816; b=oevMEbG3vPFzDMeDppcib9xJMyT2NqGBJxz9aXGcijUVzlj71Sv2zLDH+5nY/t/MmI nuBz2ZLb5YVuj2I2QVtzOcxwBOVYhGP9LzC7FBuUeA1Ub/8QDEGRb66BktE/2q1mZ3NY eBJX+4fmxlj9hgLogjyxtScQqs7vlqgUjlb6Rn8Mr0Sis4t3Ennx/EXeWGKgW6Sdm322 Ge5YIqKLIcp5SaVlnrantDbhufWbewhzqWQCHMLc9DZv8gS0delV+9cgCv/B4C7eQI/W n3Uisy+Km566n8hcl8ExLKcMgFHzWf9b42SWjofofpO4sXpLX0bLDVoUt8hEGP/euBx0 rGJA== 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=Ioxr2JtPMKHBRfEX6PMu7EWarlC3U+Bci3qDUtqeEEM=; fh=njrOnqy+uOC/eywmsVAmwO0A7biLXjf73x50f7/uewA=; b=OthSYao64ybTuKNVw2KMCQNB5IBjEI/Y3/TV2icRy/EESU+9Oys2vYYQi7PNyV4aY3 Ftbn0WD4XV3PgdoNK5IyJhqKBvlsXhQWLSK/vSAfmtBvrmaxT7nNE9ykiQQ9Zyizm6zt G5v98dtn0PplD+uKsIzJRGaqds7HNAUsuhxowkRlR7v1SyJjRkBiHinaCmxmYuRbq8L1 duwZxXx6e9x/9V+qUinGKdb+wshc5fxcRizFhA8lU9+iFhpB0yvBpTrjDFUB812J9u08 Sc1aNCue3BcqnxWZ98eL4rk0MZdU6E2wc2+zAsRrWvm0dfzd0PzEphakbpS0ke0iBgQH a1qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HeyeRT4v; 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 c19-20020aa7df13000000b005223fbd4d87si1233869edy.503.2023.07.25.01.07.12; Tue, 25 Jul 2023 01:07:36 -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=HeyeRT4v; 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 S230379AbjGYGuO (ORCPT + 99 others); Tue, 25 Jul 2023 02:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjGYGuM (ORCPT ); Tue, 25 Jul 2023 02:50:12 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72FE68E; Mon, 24 Jul 2023 23:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690267811; x=1721803811; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=sMXp8XuVx7sja1Zb9TfJOl/mMXazPG34qUPoSd0z870=; b=HeyeRT4vEGYP1dT/vgdWjFTZL8Y2iA5lgHvM7mSuhlQxvlztFQqxXBSO AJLgrY5ew5b6ZY1UoTUVwiF5SQAczoe5OitkA4g4ASwXaKS/cJ2UGjWsi nfqUy7fpaPIXfvFNDqN7MVudSMpTX0xE8gaUIf+AaPZFfcrgr9fOwg6AT CRA+vp563AkOGU573kRhqOKeRgMUZYYxrLiBz4nhkZUcMBIz1pfR2AHrb qF35cDrIGlZT+uWmMtFYw+Pa7katgTa6CXQjLkHcBh6WXlOxQT+krOBz6 z4yQCnZxZSw3hPQsKZE4CzwHRfxCxX3MJ3vKSPMaiAOeIyQAwUxV4EgRR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="347242146" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="347242146" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 23:50:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="1056698073" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="1056698073" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 23:49:39 -0700 From: "Huang, Ying" To: Alistair Popple Cc: Andrew Morton , , , , , , "Aneesh Kumar K . V" , Wei Xu , Dan Williams , Dave Hansen , "Davidlohr Bueso" , Johannes Weiner , "Jonathan Cameron" , Michal Hocko , Yang Shi , Rafael J Wysocki Subject: Re: [PATCH RESEND 3/4] acpi, hmat: calculate abstract distance with HMAT In-Reply-To: <87ila8zo80.fsf@nvdebian.thelocal> (Alistair Popple's message of "Tue, 25 Jul 2023 12:45:01 +1000") References: <20230721012932.190742-1-ying.huang@intel.com> <20230721012932.190742-4-ying.huang@intel.com> <87ila8zo80.fsf@nvdebian.thelocal> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Date: Tue, 25 Jul 2023 14:47:47 +0800 Message-ID: <87h6psxzak.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_PASS,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 Alistair Popple writes: > Huang Ying writes: > >> A memory tiering abstract distance calculation algorithm based on ACPI >> HMAT is implemented. The basic idea is as follows. >> >> The performance attributes of system default DRAM nodes are recorded >> as the base line. Whose abstract distance is MEMTIER_ADISTANCE_DRAM. >> Then, the ratio of the abstract distance of a memory node (target) to >> MEMTIER_ADISTANCE_DRAM is scaled based on the ratio of the performance >> attributes of the node to that of the default DRAM nodes. > > The problem I encountered here with the calculations is that HBM memory > ended up in a lower-tiered node which isn't what I wanted (at least when > that HBM is attached to a GPU say). I have tested the series on a server machine with HBM (pure HBM, not attached to a GPU). Where, HBM is placed in a higher tier than DRAM. > I suspect this is because the calculations are based on the CPU > point-of-view (access1) which still sees lower bandwidth to remote HBM > than local DRAM, even though the remote GPU has higher bandwidth access > to that memory. Perhaps we need to be considering access0 as well? > Ie. HBM directly attached to a generic initiator should be in a higher > tier regardless of CPU access characteristics? What's your requirements for memory tiers on the machine? I guess you want to put GPU attache HBM in a higher tier and put DRAM in a lower tier. So, cold HBM pages can be demoted to DRAM when there are memory pressure on HBM? This sounds reasonable from GPU point of view. The above requirements may be satisfied via calculating abstract distance based on access0 (or combined with access1). But I suspect this will be a general solution. I guess that any memory devices that are used mainly by the memory initiators other than CPUs want to put themselves in a higher memory tier than DRAM, regardless of its access0. One solution is to put GPU HBM in the highest memory tier (with smallest abstract distance) always in GPU device driver regardless its HMAT performance attributes. Is it possible? > That said I'm not entirely convinced the HMAT tables I'm testing against > are accurate/complete. -- Best Regards, Huang, Ying