Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5540489yba; Mon, 13 May 2019 12:41:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW3jCgOBsU1ZbHXUKbH4/AqsgeB91bA2UZoTOLSZuKoEh6CFQ/u+JQlxZKlsh2VInfnwNM X-Received: by 2002:a17:902:100a:: with SMTP id b10mr30633643pla.239.1557776473102; Mon, 13 May 2019 12:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557776473; cv=none; d=google.com; s=arc-20160816; b=H3mxs4Nf4nmosXjY/hZW5VF1inkH54UJWMzZb2M/3ukM9htkw9XtV8x3KgI+5hc2EG 8YG6Y7arwFUYqDPlcuaDiNj2S8ba3ofQDeROP7eniyFN6t9lI2MkbC7wGleFWO4KeWri Qz/kluVvGtWLzkGvbI2XmPE2tD4lNTi9N5UTQoMtGxkthP2abVKKt2kZHI7BpEcCpWX3 d4vT5n4dG3JDzh1aK1oM2lot2LN4aUvaI5DEjmiJKVKhXGDY+/BQNMjuh9SRhjnhG/2+ UI+ssqdBfHmMX3FdKJSrnrv28l53jkvfWoTv5JyX5P8XjJtDmylnuu5wtHo7Ib0EJUOQ qS2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Z71GcKSEW2yozRMqKRKdCmHVIZSDcnANBFWNGtvu1ok=; b=TdFGvooc9n7O+YKcQqtas2LeFK4F6H/aOm6b2cnAvq1o/1lfuLooIEb4ZdbmLdaxT7 gLsZ0Gi52gYDpj0gicHz3XlBZnEs2rerNMhPw92JALigzp8PEB28r+ZdJf3Hv4xQj04n LaVZ0WIMp30TNuPGrga6qOsky6X3TjLlwYtR7dmW6uMaajy8tXviuW98tVALslSxm1w/ 3PDP9FhT3r7uEBXIyteXl/KemvDIpy8hrk4gE8C1G5kya5MBxGdfW7LOlLqMqSISFmUk YqWpkW+tvoX2s9LCiVwtQNiOolFSgBk84TPEl6CKf/a/LgC6jcm3do/rX5cGgwt1F8Sz qd2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oVjN6mPS; 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 t11si3690577pfa.190.2019.05.13.12.40.57; Mon, 13 May 2019 12:41:13 -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=@gmail.com header.s=20161025 header.b=oVjN6mPS; 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 S1732177AbfEMR7s (ORCPT + 99 others); Mon, 13 May 2019 13:59:48 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38204 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732167AbfEMR7o (ORCPT ); Mon, 13 May 2019 13:59:44 -0400 Received: by mail-pg1-f195.google.com with SMTP id j26so7149475pgl.5 for ; Mon, 13 May 2019 10:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:organization; bh=Z71GcKSEW2yozRMqKRKdCmHVIZSDcnANBFWNGtvu1ok=; b=oVjN6mPSIATPA9EbQ1SbCu2VSUnGk8a25O+1p/Ew0caEhAE4nw47ZNXsceUdC6taqM WWlVQ5HsjdtMkbtToFLCmPEzu1GwvBCHqx/wlF85EmA5KwK0wtUSCbqnMj3RLQf0WNMI xXEOh4G8HlEyYNbxC7CWXM5KYzjO3b9EGlFZ8AtQzSdGUmCzAcxjtndOF/IWaMbPoSFv qdy93c7pLldnMwOEU0848wbeD0VOV0hb+v14UnNlE7sfNS+xS0ZeRBdvEZxCcAEnhxHL hWKC+NZPvxc4sg2xKXhraYquKs3NRotOSv3aJr+TJanv65sUXMpTnmiRAWzpRriQFlve YFAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:reply-to:organization; bh=Z71GcKSEW2yozRMqKRKdCmHVIZSDcnANBFWNGtvu1ok=; b=gZ5ethLErBUwLaODyD6/fPyKc69m7JD4lxXTP/wTZO2d83WS991lwT5Zbb+OR+VbST Pnce1h2eVCjUo1wlwkOs6O1DQxrNGxN/jAIZIFkCOWZ6Ri7GWCDIEBqBYx0JpOEGiUI6 cxX4yaePmEIJaLUB/SNkzxHLEvRoHGtvV39bJr1o3ibvM6sQYWhjCA/4gXt2ppwINs5k thI+ibOwxqdy7GKQg+w2TiuqfWoKL70oBX4itWFjM9b4cwPZDY1roh2G4t0fWUrTVv25 Dx2sY5vk3QDWS648qcXutQiNg/kUau9oidTDtCcskMg6E6yl3dzgG7CD7wK8IBk+ewe+ bDeQ== X-Gm-Message-State: APjAAAUMzKx06CJjAGZ1LYVCqxQuwMiuzs+gOo7LONrAzJ01EjNp4RmZ ZohVzYxfVr5AGkBgNffzRua6IGmk X-Received: by 2002:a63:1344:: with SMTP id 4mr32641949pgt.448.1557770383896; Mon, 13 May 2019 10:59:43 -0700 (PDT) Received: from localhost.localdomain ([96.79.124.202]) by smtp.gmail.com with ESMTPSA id s12sm9536266pfd.152.2019.05.13.10.59.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 10:59:43 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Kan Liang , Len Brown Subject: [PATCH 19/19] perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support Date: Mon, 13 May 2019 13:59:03 -0400 Message-Id: <0ddb97e121397d37933233da303556141814fa47.1557769318.git.len.brown@intel.com> X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <7b23d2d26d717b8e14ba137c94b70943f1ae4b5c.1557769318.git.len.brown@intel.com> References: <7b23d2d26d717b8e14ba137c94b70943f1ae4b5c.1557769318.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang 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 --- 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; -- 2.18.0-rc0