Skip to content

Commit e1ed37b

Browse files
sandip4nIngo Molnar
authored andcommitted
perf/x86/amd/uncore: Add parameter to configure hrtimer
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/6cb0101da74955fa9c8361f168ffdf481ae8a200.1744906694.git.sandipan.das@amd.com
1 parent 6d937e0 commit e1ed37b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/events/amd/uncore.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ struct amd_uncore {
8787

8888
static struct amd_uncore uncores[UNCORE_TYPE_MAX];
8989

90+
/* Interval for hrtimer, defaults to 60000 milliseconds */
91+
static unsigned int update_interval = 60 * MSEC_PER_SEC;
92+
module_param(update_interval, uint, 0444);
93+
9094
static struct amd_uncore_pmu *event_to_amd_uncore_pmu(struct perf_event *event)
9195
{
9296
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)
545549
}
546550

547551
amd_uncore_init_hrtimer(curr);
548-
curr->hrtimer_duration = 60LL * NSEC_PER_SEC;
552+
curr->hrtimer_duration = (u64)update_interval * NSEC_PER_MSEC;
549553

550554
cpumask_set_cpu(cpu, &pmu->active_mask);
551555
}

0 commit comments

Comments
 (0)