Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp178558img; Mon, 25 Feb 2019 20:43:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IbNUuFRL9mtovx6kkPPaexkZC1w9Qb7cTxy0AoMkMsK3khY8uIcWwlzThqOa23JSdE6me86 X-Received: by 2002:a63:c449:: with SMTP id m9mr3875663pgg.41.1551156189984; Mon, 25 Feb 2019 20:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551156189; cv=none; d=google.com; s=arc-20160816; b=yoxs/rvuhJrQTrI5NepTVKoR+Rs9RFxFHVMbH7Nc6hYC3514fDsFWCT6k5vpjHZzCc 9Dp1a1+CKQ11dkMMNvVqneovgHYyhfkytP38WJXO4okctgFdH5SbsBvXwc60wBrZ43tc clrMg8tQxCU7afQExgacmi3SOPqJFbQMfSwEFLQt0pDyTlMcnGNEajWzAUEHoif18fJS OKpiRDBXK+u6AE8wGKRyOde2yhngp4EEx2fz8aHIa0LpmkTpZ5N3sSG1ffHGhiWWg6Dq LKyH1znGSY4T/lNAssGyJQeGm+NaxOayuuwlqc9oqY1AwK9RARvAD6KSkipIzSMj1JQ3 KGVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=UuQlt9L8qlW7r7nNzDBXWdjkl9tQ/HGk4NOC4kHPowQ=; b=cXj4KyJXM6pkaGFI8XrMP2JOrWrQUOjBGms59i0C5S6Joi23zImWkyTBbuYFNUmcVZ nkosdQ/IOkm5xlWCPLOvupeDJ+jZ62cwOQSbFSnr4WSRmM8/S6rrGxDXBBBIbWmwx7q7 +FUXgPgZWsZfQOhMR/O+gYz7VLAlpqKyIgHUCltIXn2sGouaCvZ+qN1uv1C3pSoGuNov N3CNRGjoAlHyr9Wd+1rSHNOgh6g2cJwn27wu4/wKO0PbITSMISDMXxIhcvQv+QVeRYwO j74Qo+69j4vlTPr3G0I0dC0rXEZn8mYnICYczjQWhj2uTBhCeyXoRnoFrQ6jnacqCmHz 86lw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h62si11054432pgc.227.2019.02.25.20.42.43; Mon, 25 Feb 2019 20:43:09 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726250AbfBZEmM (ORCPT + 99 others); Mon, 25 Feb 2019 23:42:12 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39696 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbfBZEmM (ORCPT ); Mon, 25 Feb 2019 23:42:12 -0500 Received: by mail-ed1-f66.google.com with SMTP id p27so9586833edc.6; Mon, 25 Feb 2019 20:42:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UuQlt9L8qlW7r7nNzDBXWdjkl9tQ/HGk4NOC4kHPowQ=; b=JCcc2ca7QSjjq7BB8x/OFlcOGzHHbvsfnd8PmTgnfkmnKxj25p6APC+d3sQlkD6LWy uJt7pEtTk4yN0IA3QNg4m7plujlF1ncbEVqqfTbQm378i2S79hXwn1TBrMya2xWwT1sP EBFdpNkibqLD+fjX2SxChs4fueXUcHDw0kuSCPwMZsgemno1U2XtlGu0A7cyiu02F1JS MuAQ70vC5jwIY69sb/MsTcRD0B9j2Kju8j+/sPR4Ze8ZMeDylxqI0Hg4GTMIsZnDeTjq 9f9XELoOmyHgFd7U1EWcyxyz78Rs8gDvAxJ0Fc79bq0Dw8ZL8CBjhiHGgmCytq+cWmjh MZIA== X-Gm-Message-State: AHQUAuYtY5LPx748zO1PM3bvzYcW45rboA/Plt4JE4Yttvd/rll12Qt+ MmsV5wW9Ge+XhIaxIsZWjU93Nb3Drn7ECjd5Q5E= X-Received: by 2002:a50:91d6:: with SMTP id h22mr269654eda.296.1551156130365; Mon, 25 Feb 2019 20:42:10 -0800 (PST) MIME-Version: 1.0 References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> <3349c9e551eecbfe849320c0e938daf4e0126734.1550545163.git.len.brown@intel.com> <20190220110200.GD17969@hirez.programming.kicks-ass.net> In-Reply-To: From: Len Brown Date: Mon, 25 Feb 2019 23:41:58 -0500 Message-ID: Subject: Re: [PATCH 08/11] powercap/intel_rapl: Support multi-die/package To: Peter Zijlstra Cc: X86 ML , linux-kernel@vger.kernel.org, Zhang Rui , Len Brown , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 12:44 AM Len Brown wrote: > > On Wed, Feb 20, 2019 at 6:02 AM Peter Zijlstra wrote: > > > > 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. > > That is fair. > > Seems that a subsequent re-name-only patch is appropriate. I'm not sure that re-naming these functions is a good idea. Fundamentally, the reason stems from the SDM being in-consistent. And the reason that the SDM is inconsistent is for compatibility. ie. the PACKAGE MSRs in the SDM are still called PACKAGE MSRs, even though on a multi-die system, they are DIE scoped. There is no plan to re-name all of those MSRs. And so what do you call a routine that parses a PACKAGE_RAPL domain? Well, it is still called PACKAGE MSR, even though the code is smart enough to know that on a multi-die system, its scope is die-scoped, not package-scoped. And yes, just to confuse things, there WILL be PACKAGE scope MSRs in the future that span multiple die on multi-die systems. No, it will not be a surprise when they appear -- by definition, they will be different and incompatible with previous PACKAGE MSRs. We will need to update some software to be smart about handling them -- no blind assumptions on using the word "package" in this context. So unless Rui disagrees, I'm inclined to leave these routine names alone. thanks, Len Brown, Intel Open Source Technology Center