Re: [PATCH] tracing: Fix context switch counter truncation

Breno Leitao <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
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: [email protected]
> Reported-by: Breno Leitao <[email protected]>
> Signed-off-by: Usama Arif <[email protected]>

Reviewed-by: Breno Leitao <[email protected]>

Thanks for the investigation and fix,
--breno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.