Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp105561imu; Mon, 10 Dec 2018 17:10:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/WVXak5r2cRRpPz74uIpMGu3r7plpEk7KItnPBwukPk/i80yqGKc6hxCw6Inrd7gQYXEkN9 X-Received: by 2002:a17:902:a6:: with SMTP id a35mr14150036pla.201.1544490646194; Mon, 10 Dec 2018 17:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544490646; cv=none; d=google.com; s=arc-20160816; b=a7eiTDrmpY5PVUDWNYRQnZfcTB1XaJcrhFqxRyNLhlU1+0QHXPp3N8T0M5ZTmli3Vk SnaQNgevWK6ofPx4Fm4qAVZMGcTtJSLgld9kXxK23cVNSfgsLBOCWmSf4lwVnzVoZVIo 6VpEhs+/ohy/cTIPmC2jR32BoAvtYjkItPIRRWqF5JmYNj8Ei1pgjm2h6Tf8ujVUk7kc /Xa+eA2qsKYi4/+BEbka5Ws6NDsGgrK+hJEFa5ElxokX+q2y09yrIlUde60EGEyPT9OD OufFmFA7V/2C4qRlkdmgug2ToY7rYbovNQOjRDzkTl/LIl+A4jKfsieEJ1yOkGxXLwJM sdbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=XzzfcgukkKwDBclGDQbUCtNL+P+RjuB9l9JOozcqmXQ=; b=DROBZTVSLK0awyHDSCnavcVNHi8VpBavnYsYmQJYBGkWi3AmV71RUas/Q9lI3F1qsC gjyepZkBHc8xdXBUn3lbKzk/4bHcT9MTgM+fR0Q1nsqmYIEeweXlmtbFGZs3a3kvBYz6 BqzHkzZIl4qIufFA1tm3SYVjmjVQ3xlcan1L3OalF4Dr3GfLgKJqzzRGdyAbvcSwRd8i RQeX9rKYBgh/3n72+BHXyz9ZLGw1VUf7iZvvXdLilEfstmMyLX2JIRKIBmuvL4ORL1pk jbvXoKjfTUzXqag5kZ8xi4hW0n88IcDi4eA3s+fV259okqyaIXhHN32w33u5umL4KBLO smtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si10162136pgi.513.2018.12.10.17.10.31; Mon, 10 Dec 2018 17:10:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729571AbeLKBFx (ORCPT + 99 others); Mon, 10 Dec 2018 20:05:53 -0500 Received: from mga02.intel.com ([134.134.136.20]:24625 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729465AbeLKBFv (ORCPT ); Mon, 10 Dec 2018 20:05:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 17:05:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,340,1539673200"; d="scan'208";a="117705205" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by orsmga001.jf.intel.com with ESMTP; 10 Dec 2018 17:05:50 -0800 From: Keith Busch To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org Cc: Greg Kroah-Hartman , Rafael Wysocki , Dave Hansen , Dan Williams , Keith Busch Subject: [PATCHv2 08/12] acpi/hmat: Register performance attributes Date: Mon, 10 Dec 2018 18:03:06 -0700 Message-Id: <20181211010310.8551-9-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20181211010310.8551-1-keith.busch@intel.com> References: <20181211010310.8551-1-keith.busch@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Save the best performance access attributes and register these with the memory's node if HMAT provides the locality table. Signed-off-by: Keith Busch --- drivers/acpi/Kconfig | 1 + drivers/acpi/hmat.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 9a05af3a18cf..6b5f6ca690af 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -330,6 +330,7 @@ config ACPI_NUMA config ACPI_HMAT bool "ACPI Heterogeneous Memory Attribute Table Support" depends on ACPI_NUMA + select HMEM_REPORTING help Parses representation of the ACPI Heterogeneous Memory Attributes Table (HMAT) and set the memory node relationships and access diff --git a/drivers/acpi/hmat.c b/drivers/acpi/hmat.c index 5d8747ad025f..40bc83f4b593 100644 --- a/drivers/acpi/hmat.c +++ b/drivers/acpi/hmat.c @@ -23,6 +23,8 @@ struct memory_target { struct list_head node; unsigned int memory_pxm; unsigned long p_nodes[BITS_TO_LONGS(MAX_NUMNODES)]; + bool hmem_valid; + struct node_hmem_attrs hmem; }; static __init struct memory_target *find_mem_target(unsigned int m) @@ -108,6 +110,34 @@ static __init void hmat_update_access(u8 type, u32 value, u32 *best) } } +static __init void hmat_update_target(struct memory_target *t, u8 type, + u32 value) +{ + switch (type) { + case ACPI_HMAT_ACCESS_LATENCY: + t->hmem.read_latency = value; + t->hmem.write_latency = value; + break; + case ACPI_HMAT_READ_LATENCY: + t->hmem.read_latency = value; + break; + case ACPI_HMAT_WRITE_LATENCY: + t->hmem.write_latency = value; + break; + case ACPI_HMAT_ACCESS_BANDWIDTH: + t->hmem.read_bandwidth = value; + t->hmem.write_bandwidth = value; + break; + case ACPI_HMAT_READ_BANDWIDTH: + t->hmem.read_bandwidth = value; + break; + case ACPI_HMAT_WRITE_BANDWIDTH: + t->hmem.write_bandwidth = value; + break; + } + t->hmem_valid = true; +} + static __init int hmat_parse_locality(union acpi_subtable_headers *header, const unsigned long end) { @@ -166,6 +196,8 @@ static __init int hmat_parse_locality(union acpi_subtable_headers *header, set_bit(p_node, t->p_nodes); } } + if (t && best) + hmat_update_target(t, type, best); } return 0; } @@ -267,6 +299,8 @@ static __init void hmat_register_targets(void) m = pxm_to_node(t->memory_pxm); for_each_set_bit(p, t->p_nodes, MAX_NUMNODES) register_memory_node_under_compute_node(m, p); + if (t->hmem_valid) + node_set_perf_attrs(m, &t->hmem); kfree(t); } } -- 2.14.4