Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp442851imp; Wed, 20 Feb 2019 03:02:51 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibv+Hk0t/qJyPyB5/bgtNC0DwXRYKUushigMrmpO7ogDadzk01gygH+VyOx71zK+fHWk69f X-Received: by 2002:a17:902:be02:: with SMTP id r2mr23607566pls.209.1550660571154; Wed, 20 Feb 2019 03:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550660571; cv=none; d=google.com; s=arc-20160816; b=MYZABT8orBS8d+T08+V40ku5oVrPbwvbF6ughxawfopK4hgkF9agL/hzhS0ZbdRhKn OILAYzYL8wKohYQ22vG5Jp52eh6fm1GHI0fdC5PSTG7IjtW2mUvuL3UWn+nym4DD5oqF 85CRAP9SqTYiqqXl2p7+OgysU10DCJ9JB73EODHPZ2SXjb4EljsZg1SrGbKcTLcNeMtK 3T30+I73F77jtd+knJjhSAYLzCPA2X3QyAIR4RQefMVMRFrZlYLJH/lM9xS6shZzG9/x VkzFIf9Ly1BlL3DlvLGzzsB+jJ/NoVzudOfr2NI512qtF5ThAZJCJxcXVqfKf074/o5/ EBTQ== 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=GYhJeV+fLV9/dIUemPOV49aBd2YkkdKMheInEI2nw1s=; b=XWDrqzcGQPeoNf3UCopsQOh5hbm3AJKbaKM5P/KERnLtWHhqbugKQwX91STq1sUwnu 8NCr+0c4A0Ta8bzz+W/xyzMFTrZ3z5tYSHel61IKjoKtH0bYsr6V3KJGeujq62KKF8bQ yg6NO1nQpc+N5qiNt6r/6p9Xu9FrV73D2fPKJ6l4lLm8DQy0sjYX13J7hZbbeARsWn9Q QCK/gzmqjelnZqtkWinGfMKe2lGYf0rGgPPccEIfG7PDfeG0sslazmdKVUaxp31zqcWA JrWNYRVttXlvbrZFUoqcIT0thPwonbjKd5ei4VdM5Aet8PMSAs5QCLeQjL22p+fHjOgo 7P6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=GuvqglkF; 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 8si11187724pgf.361.2019.02.20.03.02.31; Wed, 20 Feb 2019 03:02:51 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=GuvqglkF; 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 S1727632AbfBTLCD (ORCPT + 99 others); Wed, 20 Feb 2019 06:02:03 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:40178 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbfBTLCD (ORCPT ); Wed, 20 Feb 2019 06:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=GYhJeV+fLV9/dIUemPOV49aBd2YkkdKMheInEI2nw1s=; b=GuvqglkFSWsUrlL8ZB6LGtJGf l8QEQUoQyXiYwdI8fqrIcfMwTKZHCzV+sqj326Q93QbuOGnb1sXOllr0uAB5ugvhwrB52X5k3MS6T fqkIwlwRL3HTseC14GnR84aVO42LzNgte9bEcg9krQuDxPvWb4fGNjDipgfRtOA1twceluG2rSsO2 j6rjFPTbCKwKZM4akzORehve5h9jTSAHFcWwS6g8eMtosmQuhaK/KZczo4AtMRdCi1fTrPYx2FT0i pQMUsD2rUVcJZmVj+nu+StvOkM7JQJ4cmZtCLFVUvM6vF/CNg2HolI24+LfhDAQQDEipAFzm12noi Dxd59YSyA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwPda-0008Mn-Kl; Wed, 20 Feb 2019 11:02:02 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EE6C5202BC402; Wed, 20 Feb 2019 12:02:00 +0100 (CET) Date: Wed, 20 Feb 2019 12:02:00 +0100 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 08/11] powercap/intel_rapl: Support multi-die/package Message-ID: <20190220110200.GD17969@hirez.programming.kicks-ass.net> References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> <3349c9e551eecbfe849320c0e938daf4e0126734.1550545163.git.len.brown@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3349c9e551eecbfe849320c0e938daf4e0126734.1550545163.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, Feb 18, 2019 at 10:40:10PM -0500, Len Brown wrote: > From: Zhang Rui > > On the new dual-die/package systems, the RAPL MSR becomes die-scope. > Thus instead of one powercap device per physical package, now there > should be one powercap device for each unique die on these systems. > > This patch introduces intel_rapl driver support for new > dual-die/package systems. > > On the hardwares that do not have multi-die, topology_unique_die_id() > equals topology_physical_package_id(), thus there is no functional change. > > Signed-off-by: Zhang Rui > Signed-off-by: Len Brown > Cc: linux-pm@vger.kernel.org > Signed-off-by: Len Brown > --- > 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 6057d9695fed..e004707283da 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(int cpu) > { > - int id = topology_physical_package_id(cpu); > + int id = topology_unique_die_id(cpu); > struct rapl_package *rp; > > list_for_each_entry(rp, &rapl_packages, plist) { > @@ -1457,7 +1457,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_unique_die_id(cpu); > struct rapl_package *rp; > int ret; And now your new function names are misnomers.