mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Tero Kristo" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Kan Liang <kan.liang@intel.com>,
	Tero Kristo <tero.kristo@linux.intel.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf/x86/cstate: Allow reading the package statistics from local CPU
Date: Tue, 10 Oct 2023 08:19:31 -0000	[thread overview]
Message-ID: <169692597189.3135.6821303889491635231.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230912124432.3616761-2-tero.kristo@linux.intel.com>

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     05276d4831fe023b6674a72bd6b8c5b39796e690
Gitweb:        https://git.kernel.org/tip/05276d4831fe023b6674a72bd6b8c5b39796e690
Author:        Tero Kristo <tero.kristo@linux.intel.com>
AuthorDate:    Tue, 12 Sep 2023 15:44:31 +03:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 09 Oct 2023 16:12:22 +02:00

perf/x86/cstate: Allow reading the package statistics from local CPU

The MSR registers for reading the package residency counters are
available on every CPU of the package. To avoid doing unnecessary SMP
calls to read the values for these from the various CPUs inside a
package, allow reading them from any CPU of the package.

Suggested-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20230912124432.3616761-2-tero.kristo@linux.intel.com
---
 arch/x86/events/intel/cstate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 96fffb2..cbeb6d2 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -336,6 +336,9 @@ static int cstate_pmu_event_init(struct perf_event *event)
 		cfg = array_index_nospec((unsigned long)cfg, PERF_CSTATE_PKG_EVENT_MAX);
 		if (!(pkg_msr_mask & (1 << cfg)))
 			return -EINVAL;
+
+		event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG;
+
 		event->hw.event_base = pkg_msr[cfg].msr;
 		cpu = cpumask_any_and(&cstate_pkg_cpu_mask,
 				      topology_die_cpumask(event->cpu));

  parent reply	other threads:[~2023-10-10  8:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 12:44 [RESEND PATCH 0/2] perf/x86: Package residency counter improvements Tero Kristo
2023-09-12 12:44 ` [RESEND PATCH 1/2] perf/x86/cstate: Allow reading the package statistics from local CPU Tero Kristo
2023-09-13 12:59   ` [PATCHv2 2/2] perf/core: Allow reading package events from perf_event_read_local Tero Kristo
2023-10-03 11:00     ` Peter Zijlstra
2023-10-10  8:19     ` [tip: perf/core] " tip-bot2 for Tero Kristo
2023-10-10  8:19   ` tip-bot2 for Tero Kristo [this message]
2023-09-12 12:44 ` [RESEND PATCH 2/2] " Tero Kristo
2023-09-12 14:04   ` Peter Zijlstra
2023-09-12 14:54     ` Tero Kristo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=169692597189.3135.6821303889491635231.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tero.kristo@linux.intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®