From: Sandipan Das <sandipan.das@amd.com>
To: <linux-perf-users@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
<namhyung@kernel.org>, <mark.rutland@arm.com>,
<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
<irogers@google.com>, <adrian.hunter@intel.com>,
<kan.liang@linux.intel.com>, <tglx@linutronix.de>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
<eranian@google.com>, <songliubraving@meta.com>,
<ravi.bangoria@amd.com>, <ananth.narayan@amd.com>,
<sandipan.das@amd.com>
Subject: [PATCH v2 4/5] perf/x86/amd/uncore: Add parameter to configure hrtimer
Date: Fri, 18 Apr 2025 09:13:02 +0530 [thread overview]
Message-ID: <6cb0101da74955fa9c8361f168ffdf481ae8a200.1744906694.git.sandipan.das@amd.com> (raw)
In-Reply-To: <cover.1744906694.git.sandipan.das@amd.com>
Introduce a module parameter for configuring the hrtimer duration in
milliseconds. The default duration is 60000 milliseconds and the intent
is to allow users to customize it to suit jitter tolerances. It should
be noted that a longer duration will reduce jitter but affect accuracy
if the programmed events cause the counters to overflow multiple times
in a single interval.
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
---
arch/x86/events/amd/uncore.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index e09bfbb4a4cd..70e0af36c378 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -87,6 +87,10 @@ struct amd_uncore {
static struct amd_uncore uncores[UNCORE_TYPE_MAX];
+/* Interval for hrtimer, defaults to 60000 milliseconds */
+static unsigned int update_interval = 60 * MSEC_PER_SEC;
+module_param(update_interval, uint, 0444);
+
static struct amd_uncore_pmu *event_to_amd_uncore_pmu(struct perf_event *event)
{
return container_of(event->pmu, struct amd_uncore_pmu, pmu);
@@ -545,7 +549,7 @@ static int amd_uncore_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
}
amd_uncore_init_hrtimer(curr);
- curr->hrtimer_duration = 60LL * NSEC_PER_SEC;
+ curr->hrtimer_duration = (u64)update_interval * NSEC_PER_MSEC;
cpumask_set_cpu(cpu, &pmu->active_mask);
}
--
2.43.0
next prev parent reply other threads:[~2025-04-18 3:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 3:42 [PATCH v2 0/5] perf/x86/uncore: Overflow handling enhancements Sandipan Das
2025-04-18 3:42 ` [PATCH v2 1/5] perf/x86/amd/uncore: Remove unused member from amd_uncore_ctx Sandipan Das
2025-04-18 3:43 ` [PATCH v2 2/5] perf/x86/intel/uncore: Use HRTIMER_MODE_HARD for detecting overflows Sandipan Das
2025-04-18 3:43 ` [PATCH v2 3/5] perf/x86/amd/uncore: Use hrtimer for handling overflows Sandipan Das
2025-04-18 4:38 ` Stephane Eranian
2025-04-18 4:49 ` Sandipan Das
2025-04-18 3:43 ` Sandipan Das [this message]
2025-04-18 3:43 ` [PATCH v2 5/5] perf/x86/amd/uncore: Prevent UMC counters from saturating Sandipan Das
2025-04-18 8:32 ` [PATCH v2 0/5] perf/x86/uncore: Overflow handling enhancements Ingo Molnar
2025-04-18 9:27 ` Sandipan Das
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=6cb0101da74955fa9c8361f168ffdf481ae8a200.1744906694.git.sandipan.das@amd.com \
--to=sandipan.das@amd.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=songliubraving@meta.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®