linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <tero.kristo@linux.intel.com>
To: dave.hansen@linux.intel.com, tglx@linutronix.de, x86@kernel.org,
	bp@alien8.de
Cc: artem.bityutskiy@linux.intel.com, acme@kernel.org,
	bpf@vger.kernel.org, namhyung@kernel.org, mingo@redhat.com,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	irogers@google.com, hpa@zytor.com, mark.rutland@arm.com,
	jolsa@kernel.org, adrian.hunter@intel.com,
	alexander.shishkin@linux.intel.com, peterz@infradead.org
Subject: [PATCH 0/2] perf/x86: Package residency counter improvements
Date: Wed, 23 Aug 2023 08:56:51 +0300	[thread overview]
Message-ID: <20230823055653.2964237-1-tero.kristo@linux.intel.com> (raw)

Hello,

Following two patches address a couple of different issues with Intel
C-state package residency counters, which are used to track power saving
state usage on Intel chips. The patches don't have any dependencies to
each other and can be applied separately.

1) The residency counters are always read from the first CPU of the
   package via an SMP call, even if they are available from any CPU.
   This causes extra latency. Patch #1 fixes this issue by flagging
   the perf event properly and allowing to execute it on any CPU of
   the package.
2) The residency counters are completely impossible to read from a BPF
   program running on any other than the first CPU of the package, as the
   SMP call is not available in this context. Patch #2 addresses this
   issue by allowing the read of the perf event from the local CPU,
   similar to what is done in perf_read_event(). This patch also allows
   reading any other package scope perf events (RAPL/UNCORE) from
   arbitrary CPUs on a package via BPF.

-Tero



             reply	other threads:[~2023-08-23  5:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  5:56 Tero Kristo [this message]
2023-08-23  5:56 ` [PATCH 1/2] perf/x86/cstate: Allow reading the package statistics from local CPU Tero Kristo
2023-08-23  5:56 ` [PATCH 2/2] perf/core: Allow reading package events from perf_event_read_local 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=20230823055653.2964237-1-tero.kristo@linux.intel.com \
    --to=tero.kristo@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).