Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2331881img; Wed, 27 Feb 2019 14:51:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IbwEsGQtX+DhiPPnWeFUIoVYEch+LomkswxhO/eVKTBgLrTwad5Y+bsLq9Fcu6lblQ3p6JL X-Received: by 2002:a62:4754:: with SMTP id u81mr4204713pfa.66.1551307908235; Wed, 27 Feb 2019 14:51:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551307908; cv=none; d=google.com; s=arc-20160816; b=CB+9j54KOVznrCDQWZ2Ax6k4l+NgEE50YxcTwKSx3pEXV044rUtcFlD5QlfU24foPD wahw7EERJ29wJcUaUQ2R7Vv9xtuosVqsrd+w49Syc6glxjGVeV48+296d3vf2rYiVCjR GmjdHiHTHTA66G6Z6qhQ8JSpZud5+BanSqsryM+EphysO84u1MfjTdw8JMkT4Ya1WTyJ vhVL4KEC/vOX3WPCXKLdcNfqQ7gEN+0sV29U3ATC394WUYTRxr0d4qKeZsSxE48fiJuT kCvueqoi/HnT+9CzMeMxh5JIYifcrCOTHJjQ5f+XS3979zswyqeOhJ6aUIqAaUYuHiQZ zguA== 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=7Kvu3Pt4lGB8xApQX5Now06Jiasc8XtxmSQBuYXB1Sk=; b=qzBHwkKDYfhDcVELkKm28lNRHpnqfPk4uWPuQZXpTyGyBpW9iRmaSE7mBsi7fVQdzd 9btwFb/n9jSjN4vsBasDP1l27ZfUM31IRPQ7uxo+WDLEyRxYi7XV7TBxhiH3J3xnNHIY PdMlRLKi5xoDznhXXGni5Kb/bmz8Hy9/Ag3pvc9Lai8yd5Izg6zf6cYQuxQcJb3GQNnS UJ8n0NfM0IpGeamRs2WtUATKxrAbn9EOZJj7T3TAR9C2sICI6l0Hmtt7bNAD332bbuWw DE+VWerDNl53+btiywzmv0CEMYVmNmTHFXuKpUBL7nM7TQ+Gyq28OOdcuNXpqFVfoOHb Do7g== 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 u66si15086506pfu.54.2019.02.27.14.51.32; Wed, 27 Feb 2019 14:51:48 -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 S1730669AbfB0Wuu (ORCPT + 99 others); Wed, 27 Feb 2019 17:50:50 -0500 Received: from mga03.intel.com ([134.134.136.65]:4751 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730582AbfB0Wun (ORCPT ); Wed, 27 Feb 2019 17:50:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 14:50:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,420,1544515200"; d="scan'208";a="121349425" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by orsmga008.jf.intel.com with ESMTP; 27 Feb 2019 14:50:33 -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: [PATCHv7 08/10] acpi/hmat: Register performance attributes Date: Wed, 27 Feb 2019 15:50:36 -0700 Message-Id: <20190227225038.20438-9-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190227225038.20438-1-keith.busch@intel.com> References: <20190227225038.20438-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 performace 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. Acked-by: Rafael J. Wysocki Signed-off-by: Keith Busch --- drivers/acpi/hmat/Kconfig | 5 ++++- drivers/acpi/hmat/hmat.c | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/hmat/Kconfig b/drivers/acpi/hmat/Kconfig index 13cddd612a52..95a29964dbea 100644 --- a/drivers/acpi/hmat/Kconfig +++ b/drivers/acpi/hmat/Kconfig @@ -2,7 +2,10 @@ config ACPI_HMAT bool "ACPI Heterogeneous Memory Attribute Table Support" depends on ACPI_NUMA + select HMEM_REPORTING help If set, this option has the kernel parse and report the platform's ACPI HMAT (Heterogeneous Memory Attributes Table), - and register memory initiators with their targets. + register memory initiators with their targets, and export + performance attributes through the node's sysfs device if + provided. diff --git a/drivers/acpi/hmat/hmat.c b/drivers/acpi/hmat/hmat.c index bb6a11653729..5b469c98a454 100644 --- a/drivers/acpi/hmat/hmat.c +++ b/drivers/acpi/hmat/hmat.c @@ -549,12 +549,20 @@ 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); + 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