Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp135408imj; Thu, 14 Feb 2019 17:05:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1MOcS8wbCVXq//MQckiHRJNri91UpEzwwKKbJ1CXlBjII5fEL9vT77pqPcJ5kqX1Ra1xe X-Received: by 2002:a63:ea06:: with SMTP id c6mr6666379pgi.162.1550192713348; Thu, 14 Feb 2019 17:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550192713; cv=none; d=google.com; s=arc-20160816; b=gLiG7xhlDBxhQ21dyA91aJFEgjKUlJ6pZBq1VcnFXRAOS4fCqX4s53Sl9+0SvmaKfb LYcS+3UshaZsjH/AbR5/pfVU5C63opp/650RtTJu2XamNrtFX3zY/EepTpb9gR54cWlu mvp+1CgFZ3cRZQbYfX0oQr/OVfczyS8gFTwzvdhz9UaLCWwJAHuDvbPcE8+PgZ8gCGhj wUfB5ACEM+uHvBSSqlLmM3sgvYOxH9u4k9M9Rf387eWEiTEszeUbM/hSxwvXgv/bFAVD 4RwYHwVQJPsWPhOCKxfkAyEzF6gX3z7yAba2tDV1xfBnYKVooeSoWHgupmDd1nJv5vlw ExTw== 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=jPUbIWuBpn9D8LXQT3Zb7r/0pf0K4Uk+RxabChdpc14=; b=lX4qlAaScEPDahcfc8yvS35FUIjjGoFIBj9z/RYlCM0QItpLhU+lMn6iXa94l0Z3OL BZe2W/m+ZpO32F8AZNqnj+ZbogEMgZYPF6YqbOpw55OxfD3i348G36WAsMnzIT+qb7tB lp5nxFRPgclXSTd1wOk9DNYmiYPQtojqS3fss4FT3mnWazvuRZe7ZAouvm/MIqumNRLg LRtFQoT5JWW/+si9Xlmu+lc2a6BGC8ltTq2aUSvBEkGRxAVdXWwTxalOaYX/BA4/fVWx SUBHqsNie7V/VFVFuIJZ5tknKy4g6wPcaK05NclBoZqaUAlO6B+rnX8p4FbHs0dhbin4 On6Q== 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 g187si3819997pfc.43.2019.02.14.17.04.57; Thu, 14 Feb 2019 17:05:13 -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 S2437257AbfBNRLO (ORCPT + 99 others); Thu, 14 Feb 2019 12:11:14 -0500 Received: from mga05.intel.com ([192.55.52.43]:10415 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393090AbfBNRK6 (ORCPT ); Thu, 14 Feb 2019 12:10:58 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 09:10:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,369,1544515200"; d="scan'208";a="133613134" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by FMSMGA003.fm.intel.com with ESMTP; 14 Feb 2019 09:10:42 -0800 From: Keith Busch To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org Cc: Greg Kroah-Hartman , Rafael Wysocki , Dave Hansen , Dan Williams , Keith Busch Subject: [PATCHv6 08/10] acpi/hmat: Register performance attributes Date: Thu, 14 Feb 2019 10:10:15 -0700 Message-Id: <20190214171017.9362-9-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190214171017.9362-1-keith.busch@intel.com> References: <20190214171017.9362-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. While HMAT does make it possible to know performance for all possible initiator-target pairings, we export only the local pairings at this time. Signed-off-by: Keith Busch --- drivers/acpi/hmat/hmat.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/hmat/hmat.c b/drivers/acpi/hmat/hmat.c index b29f7160c7bb..6833c4897ff4 100644 --- a/drivers/acpi/hmat/hmat.c +++ b/drivers/acpi/hmat/hmat.c @@ -549,12 +549,27 @@ static __init void hmat_register_target_initiators(struct memory_target *target) } } +static __init void hmat_register_target_perf(struct memory_target *target) +{ + unsigned mem_nid = pxm_to_node(target->memory_pxm); + + if (!target->hmem_attrs.read_bandwidth && + !target->hmem_attrs.read_latency && + !target->hmem_attrs.write_bandwidth && + !target->hmem_attrs.write_latency) + return; + + node_set_perf_attrs(mem_nid, &target->hmem_attrs, 0); +} + static __init void hmat_register_targets(void) { struct memory_target *target; - list_for_each_entry(target, &targets, node) + list_for_each_entry(target, &targets, node) { hmat_register_target_initiators(target); + hmat_register_target_perf(target); + } } static __init void hmat_free_structures(void) -- 2.14.4