Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1531380ybm; Thu, 23 May 2019 02:38:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZe24oxaa3yjDtRutNPBnRbmHEyJLV8meqpWjSzHYzIdW1CTmRSbKsjtU+0Mrle45H/qVo X-Received: by 2002:a63:c509:: with SMTP id f9mr96439823pgd.143.1558604280599; Thu, 23 May 2019 02:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558604280; cv=none; d=google.com; s=arc-20160816; b=zWbFqqYAozyrs6JxYEhFdLGjJ1Bel19t6NZt4knCNukx4e4Uw82K1cNtqeNNi/mGs2 IJyvUOmFQ1TgpVORLXy+SaTpLnp28dwMJlWA9GmtY74Ppz/JznTLgu4BsrnSStbwvg+q S1IRj+a3tDJpJQiwkDwtBBWpu0oIZh7XSV9YThUDJV5AwJcnf+Yj9kFxbc9vqo4w+VhZ Xzj7dhCj/gUesLweBDy11gbIuZV3dmO/5RgP0X/JCkm1t5fyb7F6xjoBVmUxU4zvMJrr j42KffqRvwRbhhn5fuGqFR20LYeB/xe8K39fiIl+JJSLUpRI2KBwdaTYLG7WuN9GlYVR fC4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=e13fdUYn6AtPPKKJcVcv/6VhQZ3BDCrv6E5sGnhZ3eI=; b=WNGL880+YIWHc/ysppq3IDfiNnb4rB1H7v/Xh7FrDa7Law6fk2/lhpoM9x4Qf3VEmT GYfKZnCMr1unldeyVO6HgH2ciUyKr627zmxzz6r83X7ljWkniLxgLf57HweSbib1g7kY jCKCrhX+UOfVyIFSXTyHFsAmZglXeYqb8LfWjbO+B77s9mb/rHTZUKOKXO3pNYeAY3Vg ge1rqyD4N3235UsAx8X/NiYdBgNBxgh0Bw45majLPnGEi9J/zqcqiXbf4Xoq2yic0b1g zv7QzuqR4s0ZGCz4WXTnhsAuZTQIFUV/kGCzhooTP4CKvlIsCz1z8obHxJ2UeUIbEmf4 bGqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=BegBvfPf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si2019722pfr.73.2019.05.23.02.37.44; Thu, 23 May 2019 02:38:00 -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=pass header.i=@zytor.com header.s=2019051801 header.b=BegBvfPf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730284AbfEWJfp (ORCPT + 99 others); Thu, 23 May 2019 05:35:45 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33325 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbfEWJfo (ORCPT ); Thu, 23 May 2019 05:35:44 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x4N9ZWDV4043417 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 02:35:33 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x4N9ZWDV4043417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1558604133; bh=e13fdUYn6AtPPKKJcVcv/6VhQZ3BDCrv6E5sGnhZ3eI=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=BegBvfPfaP/YiaLMB4P9/5EqroWFTgP8JdvWH0dTP7oRSVyyK170h3V3dHL9yVBEe W1Asrrd4nlEut9fCTD5LGOyYmTnltuYBAf9FMWjBWRHcGtqkGK299fQ1XzZsqhgtWH Wrn0alpJwWTzRqBkS50G4sFwQl+howK5R9R45nnLGSPtpxWI+0zdStK+sju38939qb HMwRA8EHZV8hOpALvF+yBdT77mw989u5xGLDIO6EEO9IowwxtkogMArqFUwd3+IPxw SJSwNJGkEABBl/DRCfKiq3fFwJ2lLhSQugJNe5yjBcTP2ZArWDB9qov3PZrIkS7r7F RM2XL2wc5t1/w== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x4N9ZWdA4043414; Thu, 23 May 2019 02:35:32 -0700 Date: Thu, 23 May 2019 02:35:32 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, len.brown@intel.com, peterz@infradead.org, kan.liang@linux.intel.com, mingo@kernel.org, hpa@zytor.com Reply-To: peterz@infradead.org, kan.liang@linux.intel.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, len.brown@intel.com In-Reply-To: <0ddb97e121397d37933233da303556141814fa47.1557769318.git.len.brown@intel.com> References: <0ddb97e121397d37933233da303556141814fa47.1557769318.git.len.brown@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/topology] perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support Git-Commit-ID: eb876fbc248e6eb4773a5bc80d205ff7262b1bb5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: eb876fbc248e6eb4773a5bc80d205ff7262b1bb5 Gitweb: https://git.kernel.org/tip/eb876fbc248e6eb4773a5bc80d205ff7262b1bb5 Author: Kan Liang AuthorDate: Mon, 13 May 2019 13:59:03 -0400 Committer: Thomas Gleixner CommitDate: Thu, 23 May 2019 10:08:37 +0200 perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support Syntax update only -- no logical or functional change. In response to the new multi-die/package changes, update variable names to use "die" terminology, instead of "pkg". For previous platforms which doesn't have multi-die, "die" is identical as "pkg". Signed-off-by: Kan Liang Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/0ddb97e121397d37933233da303556141814fa47.1557769318.git.len.brown@intel.com --- arch/x86/events/intel/rapl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c index 6f5331271563..3992b0e65a55 100644 --- a/arch/x86/events/intel/rapl.c +++ b/arch/x86/events/intel/rapl.c @@ -148,7 +148,7 @@ struct rapl_pmu { struct rapl_pmus { struct pmu pmu; - unsigned int maxpkg; + unsigned int maxdie; struct rapl_pmu *pmus[]; }; @@ -161,13 +161,13 @@ static u64 rapl_timer_ms; static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) { - unsigned int pkgid = topology_logical_die_id(cpu); + unsigned int dieid = topology_logical_die_id(cpu); /* * The unsigned check also catches the '-1' return value for non * existent mappings in the topology map. */ - return pkgid < rapl_pmus->maxpkg ? rapl_pmus->pmus[pkgid] : NULL; + return dieid < rapl_pmus->maxdie ? rapl_pmus->pmus[dieid] : NULL; } static inline u64 rapl_read_counter(struct perf_event *event) @@ -668,22 +668,22 @@ static void cleanup_rapl_pmus(void) { int i; - for (i = 0; i < rapl_pmus->maxpkg; i++) + for (i = 0; i < rapl_pmus->maxdie; i++) kfree(rapl_pmus->pmus[i]); kfree(rapl_pmus); } static int __init init_rapl_pmus(void) { - int maxpkg = topology_max_packages() * topology_max_die_per_package(); + int maxdie = topology_max_packages() * topology_max_die_per_package(); size_t size; - size = sizeof(*rapl_pmus) + maxpkg * sizeof(struct rapl_pmu *); + size = sizeof(*rapl_pmus) + maxdie * sizeof(struct rapl_pmu *); rapl_pmus = kzalloc(size, GFP_KERNEL); if (!rapl_pmus) return -ENOMEM; - rapl_pmus->maxpkg = maxpkg; + rapl_pmus->maxdie = maxdie; rapl_pmus->pmu.attr_groups = rapl_attr_groups; rapl_pmus->pmu.task_ctx_nr = perf_invalid_context; rapl_pmus->pmu.event_init = rapl_pmu_event_init;