Re: [PATCH] tracing: Fix context switch counter truncation
From: Breno Leitao
Date: Mon Jul 20 2026 - 05:28:04 EST
On Fri, Jul 17, 2026 at 10:32:52AM -0700, Usama Arif wrote:
> This affects long-running systems and workloads with high context-switch
> rates. A CPU switching 1,000 times per second takes about 50 days.
nr_context_switches_cpu() returns "unsigned long long"
and rq->nr_switches is u64, so the unsigned int cnt truncation is real
> Fixes: 64cf7d058a00 ("tracing: Have trace_marker use per-cpu data to read user space")
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Breno Leitao <leitao@xxxxxxxxxx>
> Signed-off-by: Usama Arif <usama.arif@xxxxxxxxx>
Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>
Thanks for the investigation and fix,
--breno