Re: [PATCH 5/5] alpha/perf: optionally randomize the ProfileMe sampling interval

From: Matt Turner

Date: Fri Oct 30 2026 - 00:00:35 EST


On Thu, Oct 29, 2026 at 11:02 AM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> One minor corner case? This multiplication can overflow for very
> large sample periods. I guess normal sampling periods are not
> affected, is it worth using overflow-safe multiply/shift to avoid this
> limitation?

Yes, it overflows once the period reaches 2^35. Unlikely, but perf
allows it. v2 uses mul_u64_u32_shr(), and saturates the sum with
check_add_overflow() as well.