mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@meta.com>
To: Sandipan Das <sandipan.das@amd.com>
Cc: "linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"acme@kernel.org" <acme@kernel.org>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"irogers@google.com" <irogers@google.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"eranian@google.com" <eranian@google.com>,
	Song Liu <songliubraving@meta.com>,
	"ravi.bangoria@amd.com" <ravi.bangoria@amd.com>,
	"ananth.narayan@amd.com" <ananth.narayan@amd.com>
Subject: Re: [PATCH 4/4] perf/x86/amd/uncore: Prevent UMC counters from saturating
Date: Wed, 16 Apr 2025 19:15:25 +0000	[thread overview]
Message-ID: <C24A57FB-5898-411B-90B4-58252BC22CE9@fb.com> (raw)
In-Reply-To: <c8e5808145985bb558d8daaefe42586b74d4085d.1744184837.git.sandipan.das@amd.com>



> On Apr 9, 2025, at 12:57 AM, Sandipan Das <sandipan.das@amd.com> wrote:
> 
> Unlike L3 and DF counters, UMC counters (PERF_CTRs) set the Overflow bit
> (bit 48) and saturate on overflow. A subsequent pmu->read() of the event
> reports an incorrect accumulated count as there is no difference between
> the previous and the current values of the counter.
> 
> To avoid this, inspect the current counter value and proactively reset
> the corresponding PERF_CTR register on every pmu->read(). Combined with
> the periodic reads initiated by the hrtimer, the counters never get a
> chance saturate but the resolution reduces to 47 bits.
> 
> Fixes: 25e56847821f ("perf/x86/amd/uncore: Add memory controller support")
> Signed-off-by: Sandipan Das <sandipan.das@amd.com>

Reviewed-by: Song Liu <song@kernel.org>

Thanks for the fix!




      reply	other threads:[~2025-04-16 19:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  7:57 [PATCH 0/4] perf/x86/amd/uncore: Overflow handling enhancements Sandipan Das
2025-04-09  7:57 ` [PATCH 1/4] perf/x86/amd/uncore: Remove unused member from amd_uncore_ctx Sandipan Das
2025-04-09  7:57 ` [PATCH 2/4] perf/x86/amd/uncore: Use hrtimer for handling overflows Sandipan Das
2025-04-10  8:20   ` Peter Zijlstra
2025-04-10  8:40     ` Sandipan Das
2025-04-09  7:57 ` [PATCH 3/4] perf/x86/amd/uncore: Add parameter to configure hrtimer Sandipan Das
2025-04-09  7:57 ` [PATCH 4/4] perf/x86/amd/uncore: Prevent UMC counters from saturating Sandipan Das
2025-04-16 19:15   ` Song Liu [this message]

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=C24A57FB-5898-411B-90B4-58252BC22CE9@fb.com \
    --to=songliubraving@meta.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --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=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --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

all inboxes | Powered by JetHome®