Re: [PATCH 4/5] perf sched: Cap max_cpu at MAX_CPUS in timehist sample processing
From: Arnaldo Carvalho de Melo
Date: Fri Jun 05 2026 - 11:09:42 EST
On Fri, Jun 05, 2026 at 08:34:53AM -0600, David Ahern wrote:
> On 6/5/26 6:15 AM, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > Add bounds checks before both max_cpu updates, matching the pattern
> > already used in map_switch_event().
> > Fixes: 49394a2a24c7 ("perf sched timehist: Introduce timehist command")
> > Reported-by: sashiko-bot <sashiko-bot@xxxxxxxxxx>
> > Cc: David Ahern <dsahern@xxxxxxxxx>
> > Assisted-by: Claude Opus 4.6 <noreply@xxxxxxxxxxxxx>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > ---
> > tools/perf/builtin-sched.c | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> LGTM
> Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>
Thanks, added to the cset,
- Arnaldo