Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1073663lqm; Thu, 2 May 2024 04:43:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXawwrJysMD7wxKoj+rY8igSv3ZYMEW/7aWQ7hqySUN3+4aUMe4sBc+4JgSfgMNXbqD1DcFH2Qlxumx8T2XKVkl5kZmn5QL7oDEh0c0AA== X-Google-Smtp-Source: AGHT+IEagKb9uYh166L5ojZK2gyg6KHHbFxGM6XhN0HBkiWX3UirUF8IiQeWALblJv4OAj+I07Nb X-Received: by 2002:a17:902:c213:b0:1e4:145a:ee19 with SMTP id 19-20020a170902c21300b001e4145aee19mr4843153pll.50.1714650237177; Thu, 02 May 2024 04:43:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714650237; cv=pass; d=google.com; s=arc-20160816; b=Ec6PRvjKAAJe244NXnRL0OO4QnX82HGxvj5yigxD/q7JSRV8WNWCiGEAeenI+RRByK x2sUfRQ1QBVH2NK90tdzHmZDbilbRNifcPHx3eJi2bUy1VzOYtJN9AacXQcS9ePquOwp L+Ca6QdVh78ehrb85yQcWC5uFFfAKGOwGGZErmuBfcG7Ou9XH2ji5UIjT7hy9+Bx7Gty lSe9PaylZYXWtkJPYYAyz7/V3c4lCWOb64kn1XI6gyXH/GWIiG0xLIIHraqIVqQRPqbL W6XMVcmg4Nw5jC/BcM6UtTsWH011Zz3DFRAhjL9ZZ1Q+b1dpga8pAmup0ffagp0kLmrG e5LQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=Jzm6wh+gmO7OWFLqLVXLXzyQDUBZhRRXpOWIf8kUSMY=; fh=RcZxKYwgeiJxU7qvXcxhQGrtzIu6WT6kMVvb4Ak1XnI=; b=yQb4J30rQQVOSU1BrFycCgatZzDCRAn4WXtD1mXwT5npWKdqGvLrrALhUG7PGPlGlE kRIJGp2Hjzvwo10M5Hr1IS2utMfL3xT8FjRmwYQ/4DEosS5QbegZh9C8rym1xx3I2NUq R7Ja+SpUhO5t0DDbKz2F/iVeiCmZRkggZJjVXzkxNIQvaLB/otA6ZwFaqVqE3ERgzyyV E/sv72XKgGyCuKQMx7JBdbZoWGOSV7esaQuWOhqAH9QH0N1/JfNPCAVRW/K7gpK4LLpV XLjLonazB+zjGCFB6hIGNgXfwcCZ2ca+OyE1PVKmM4oUceh/Wi4P7RLYUvENdapDM+80 Ausg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=e5e+D3+Y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pwuz9xKk; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-166405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c8-20020a170903234800b001eb156f99d8si863324plh.71.2024.05.02.04.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 04:43:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=e5e+D3+Y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pwuz9xKk; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-166405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 29BF8B22AEB for ; Thu, 2 May 2024 11:43:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20B5B69956; Thu, 2 May 2024 11:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e5e+D3+Y"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Pwuz9xKk" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E430E64CE9; Thu, 2 May 2024 11:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714650188; cv=none; b=DnqPwVjx7yYBPBVjB6Su6Sd22zSZCa6ZEqE0wTwaZgEp8FpuTj5t+8NIVxYeyJFx/aCnCy5DJFWGV9s8d3st42XSZV8zVBH+6fAerlX/5uYMJWXRXR+E2gQUV1Mk/YO1XhYNYustMB6vIfu9+Mns+3Rv1QHCdMd5pIIqSLhJROo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714650188; c=relaxed/simple; bh=segDebKFJR58OLMOPDzjbchamkQ/rfMYFmAiqWN9efY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=cbB2p5oKnRP2ou7Zy4h+AwLjl+j/7OwO48paMMaHcLfaVaNv5CSY8mBnAmB0gH5RatjEiEwVTCnbSamKW4nPyzyEOlug/8XiAauG0UD3thhfvsPFTCVdK+Hpfn+TVk4zD0aVXsahMtofYt1UcQZ2jK62ZKQNWGegR8r6zQs0mxY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=e5e+D3+Y; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Pwuz9xKk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 02 May 2024 11:43:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714650185; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jzm6wh+gmO7OWFLqLVXLXzyQDUBZhRRXpOWIf8kUSMY=; b=e5e+D3+Yy5ih6PZmtlmef6WzaGfK+WRmEMhqGTE/kNPjBarZWgwUg8jjylwWejPHwO91Qm JBhicVgHw4qZZ4Yj9zltW53QdS5lwopAjnCPt7Su/Y1jF3S534E4VAyLeLlp+TP0F98/yI LggoYGjuXHV+3z+K695J28ZB2/P2HLsyqLnurqtSL2CYvFpK/ANDYYFM61M3D26uDAyGyJ bzEAK+W1aqlzcKGKZStpFlH/Jfz45A091OMWclwt/KIvKi/qhH7W9xo5ZybY5smQiCg8hh H5WkncxM1R7NslSfmwYvP2JeJ9/D1v6aJfIjzVRQKw7BXN3tMPdNmCXe/6a2AA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714650185; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jzm6wh+gmO7OWFLqLVXLXzyQDUBZhRRXpOWIf8kUSMY=; b=Pwuz9xKktbmJCv9AgpVvW8xlCurduDBRopKkU08T97CT5yXgyoiSIKTAlaqr5uu/AN29pU gu8gbVN/JwpVkmCQ== From: "tip-bot2 for Dhananjay Ugwekar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/rapl: Rename 'maxdie' to nr_rapl_pmu and 'dieid' to rapl_pmu_idx Cc: Dhananjay Ugwekar , Ingo Molnar , K Prateek Nayak , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240502095115.177713-2-Dhananjay.Ugwekar@amd.com> References: <20240502095115.177713-2-Dhananjay.Ugwekar@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171465018490.10875.7721607041690178507.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the perf/core branch of tip: Commit-ID: 626c5acf39ba929a0d82d37e72072e21492a958e Gitweb: https://git.kernel.org/tip/626c5acf39ba929a0d82d37e72072e21492a958e Author: Dhananjay Ugwekar AuthorDate: Thu, 02 May 2024 15:21:14 +05:30 Committer: Ingo Molnar CommitterDate: Thu, 02 May 2024 13:32:21 +02:00 perf/x86/rapl: Rename 'maxdie' to nr_rapl_pmu and 'dieid' to rapl_pmu_idx AMD CPUs have the scope of RAPL energy-pkg event as package, whereas Intel Cascade Lake CPUs have the scope as die. To account for the difference in the energy-pkg event scope between AMD and Intel CPUs, give more generic and semantically correct names to the maxdie and dieid variables. No functional change. Signed-off-by: Dhananjay Ugwekar Signed-off-by: Ingo Molnar Tested-by: K Prateek Nayak Link: https://lore.kernel.org/r/20240502095115.177713-2-Dhananjay.Ugwekar@amd.com --- arch/x86/events/rapl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index ca5f687..46e6735 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -114,8 +114,8 @@ struct rapl_pmu { struct rapl_pmus { struct pmu pmu; - unsigned int maxdie; - struct rapl_pmu *pmus[] __counted_by(maxdie); + unsigned int nr_rapl_pmu; + struct rapl_pmu *pmus[] __counted_by(nr_rapl_pmu); }; enum rapl_unit_quirk { @@ -141,13 +141,13 @@ static struct perf_msr *rapl_msrs; static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu) { - unsigned int dieid = topology_logical_die_id(cpu); + unsigned int rapl_pmu_idx = topology_logical_die_id(cpu); /* * The unsigned check also catches the '-1' return value for non * existent mappings in the topology map. */ - return dieid < rapl_pmus->maxdie ? rapl_pmus->pmus[dieid] : NULL; + return rapl_pmu_idx < rapl_pmus->nr_rapl_pmu ? rapl_pmus->pmus[rapl_pmu_idx] : NULL; } static inline u64 rapl_read_counter(struct perf_event *event) @@ -658,7 +658,7 @@ static void cleanup_rapl_pmus(void) { int i; - for (i = 0; i < rapl_pmus->maxdie; i++) + for (i = 0; i < rapl_pmus->nr_rapl_pmu; i++) kfree(rapl_pmus->pmus[i]); kfree(rapl_pmus); } @@ -674,13 +674,13 @@ static const struct attribute_group *rapl_attr_update[] = { static int __init init_rapl_pmus(void) { - int maxdie = topology_max_packages() * topology_max_dies_per_package(); + int nr_rapl_pmu = topology_max_packages() * topology_max_dies_per_package(); - rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, maxdie), GFP_KERNEL); + rapl_pmus = kzalloc(struct_size(rapl_pmus, pmus, nr_rapl_pmu), GFP_KERNEL); if (!rapl_pmus) return -ENOMEM; - rapl_pmus->maxdie = maxdie; + rapl_pmus->nr_rapl_pmu = nr_rapl_pmu; rapl_pmus->pmu.attr_groups = rapl_attr_groups; rapl_pmus->pmu.attr_update = rapl_attr_update; rapl_pmus->pmu.task_ctx_nr = perf_invalid_context;