aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@toblux.com>2024-03-29 17:02:30 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-05-13 20:00:57 -0400
commit347bd7f072ea8c36e4becf32c76ee7e96bc7b1c3 (patch)
tree84fb622b88e32d459772dc5ee58cc64a694a7cd8 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parent33f137143e651321f10eb67ae6404a13bfbf69f8 (diff)
tracing: Improve benchmark test performance by using do_div()
Partially revert commit d6cb38e10810 ("tracing: Use div64_u64() instead of do_div()") and use do_div() again to utilize its faster 64-by-32 division compared to the 64-by-64 division done by div64_u64(). Explicitly cast the divisor bm_cnt to u32 to prevent a Coccinelle warning reported by do_div.cocci. The warning was removed with commit d6cb38e10810 ("tracing: Use div64_u64() instead of do_div()"). Using the faster 64-by-32 division and casting bm_cnt to u32 is safe because we return early from trace_do_benchmark() if bm_cnt > UINT_MAX. This approach is already used twice in trace_do_benchmark() when calculating the standard deviation: do_div(stddev, (u32)bm_cnt); do_div(stddev, (u32)bm_cnt - 1); Link: https://lore.kernel.org/linux-trace-kernel/20240329160229.4874-2-thorsten.blum@toblux.com Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions