Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3670269yba; Tue, 7 May 2019 05:18:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyq0Z9UKi7FTZNAt9GndiyWR8exku/Njs2t/wMAw8NIB2Tddmd75/LG/9ldouiehEgYFDnt X-Received: by 2002:a17:902:3324:: with SMTP id a33mr7994314plc.1.1557231527442; Tue, 07 May 2019 05:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557231527; cv=none; d=google.com; s=arc-20160816; b=o/lzbDN+mE2vVmPIqIle1P3i95iFz1KI9BrA7XywPzySOMywXLviIOSwXUz0dDLK6/ JT6K1aagyRiNIl4U3cniaN4QQ+LKEP1s0lGvs+4/3uqcJf5n9XVntCJHwbzts96r7AMv A8wK8Xq3aB8lYkFQVG8GTAkDfC1kTFQrV2mpBd4y2BmDqTLXcUnE91NXaO6F88gW6XeJ obMQc5c0AuF7Gvr/9zFlcHq27WK8zF1frdELvNEfZrAdJ24nUfdaM6KO0YPw3UVmZlta 50ZLcfXWsWDnvK+voJs7BfvaOlWXuMFX7CTllP/B1GVWlZ0b7ojfcBmPKPoa6944omlS E5Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2f8uLRl8GMvPK9du+Y2zBV1bq1EpSh3gX/EwGd6390U=; b=smjlXSfoBepSVjn/Y7uWpwQQYGTdtZBQN0D+NCeA/8tZv8J7mM6yXrT2eJqeSJ1fUa stXqaJ+nqmOk0IsK3C3son1hwodgIAmEdN+QZPkTLkk2WO5Sbh3z9w3GW/MTVzaTQxVh kCCk5PpoBsouA6oIwr9fLknTD8wcUJq1eS6CCXsKasiK/lHMflurbqrdiWHtWJ1+bLZC AsiezMJ/psF3kbyOC8MMX5jmn/EBsws7qgFbj2DnLBPcD6pl++gKVXZi/c2xxLrydcsQ NjgS9e39s/AQfkTm8t67C5rmNj+J31vyeG+NZP02Y7yEzIZe0xC/1cKI2bTNqUAH0t5T sqiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=DNftd0hd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si17273021pgv.422.2019.05.07.05.18.31; Tue, 07 May 2019 05:18:47 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=DNftd0hd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726599AbfEGMPD (ORCPT + 99 others); Tue, 7 May 2019 08:15:03 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38688 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbfEGMPD (ORCPT ); Tue, 7 May 2019 08:15:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2f8uLRl8GMvPK9du+Y2zBV1bq1EpSh3gX/EwGd6390U=; b=DNftd0hd7CIq6B/3/BjfTB7f0 E6GTEB51f7SpbiXzih2qPiGrPXNDD4fr1Fpckv4UBhjLd8vSfucwuoQ0NdGsEwQNd1Dvijq4hi55e KdXmm6bnNS730A4Mb2liyRn07qsvuPYZoeq7YWCJ41dDl5kanjpfAonbchJT7nOYzpEZJF++byy8T MC4jlpctVv3kqytX865R1dFPf9VGu4hgU/FSpv1bgRMf7eyUdeq9TQNtVDXXxritIPiGJ8PB7MJq+ Ec7JUpj0Jlljqi29JjtD0P/C6XR8/IWk/PFatC6O62SXFb5C+lpqecQBLS3LyzQuXGXlTcYhoGrYK lrN/xWTaQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNyzt-0006wY-64; Tue, 07 May 2019 12:15:01 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C03542023ADB5; Tue, 7 May 2019 14:14:59 +0200 (CEST) Date: Tue, 7 May 2019 14:14:59 +0200 From: Peter Zijlstra To: Len Brown Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Zhang Rui , Len Brown , linux-pm@vger.kernel.org Subject: Re: [PATCH 10/22] powercap/intel_rapl: Support multi-die/package Message-ID: <20190507121459.GL2623@hirez.programming.kicks-ass.net> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> <9f6958c231347e639e322de8d8c3de6859559345.1557177585.git.len.brown@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f6958c231347e639e322de8d8c3de6859559345.1557177585.git.len.brown@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 06, 2019 at 05:26:05PM -0400, Len Brown wrote: > From: Zhang Rui > > RAPL "package" domains are actually implemented in hardware per-die. > Thus, the new multi-die/package systems have mulitple domains > within each physical package. > > Update the intel_rapl driver to be "die aware" -- exporting multiple > domains within a single package, when present. > No change on single die/package systems. > > Signed-off-by: Zhang Rui > Signed-off-by: Len Brown > Acked-by: Rafael J. Wysocki > Cc: linux-pm@vger.kernel.org > --- > drivers/powercap/intel_rapl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c > index 3c3c0c23180b..9202dbcef96d 100644 > --- a/drivers/powercap/intel_rapl.c > +++ b/drivers/powercap/intel_rapl.c > @@ -266,7 +266,7 @@ static struct rapl_domain *platform_rapl_domain; /* Platform (PSys) domain */ > /* caller to ensure CPU hotplug lock is held */ > static struct rapl_package *rapl_find_package_domain(int cpu) > { > - int id = topology_physical_package_id(cpu); > + int id = topology_logical_die_id(cpu); > struct rapl_package *rp; > > list_for_each_entry(rp, &rapl_packages, plist) { > @@ -1459,7 +1459,7 @@ static void rapl_remove_package(struct rapl_package *rp) > /* called from CPU hotplug notifier, hotplug lock held */ > static struct rapl_package *rapl_add_package(int cpu) > { > - int id = topology_physical_package_id(cpu); > + int id = topology_logical_die_id(cpu); > struct rapl_package *rp; > int ret; Both functions are still misnomers. rapl_find_package_domain() does in fact now do rapl_find_die_domain(), right? Same for rapl_add_package()