Skip to content

Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling

Vishal Chourasia ltp 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Enhanced thread safety in ebizzy benchmark toolutils/benchmark/ebizzy-0.3/ebizzy.c+12 -00 replies
2/2Handle high record counts and prevent integer overflowutils/benchmark/ebizzy-0.3/ebizzy.c+17 -50 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSrikar DronamrajuShrikanth Hegde
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [LTP] [PATCH 0/2] Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling

Patch 1: Enhancing Thread Safety in Ebizzy Benchmark Tool

This patch is aimed at improving the thread safety in the ebizzy benchmarking tool. A potential issue was identified where the shared variable 'records_read' was susceptible to race conditions when concurrently updated by multiple threads. This behavior could lead to skewing of the benchmark results. To mitigate this issue, a mutex for 'records_read' is introduced in this patch. The mutex ensures thread-safe updates and consequently improves the reliability of the benchmark.

Patch 2: Enhanced Record Count Handling

This patch modifies ebizzy.c to handle situations with high record counts more effectively, especially when the count exceeds UINT_MAX. It includes adjusting the records_read variable type from unsigned int to unsigned long long. This adjustment allows the benchmark tool to handle a broader range of record counts accurately. Additionally, the patch introduces error checking for integer overflow during the summation of local_records_read to records_read. Upon detecting an overflow, an appropriate error message is displayed, and the program exits.

These improvements cater to scenarios where ebizzy is run with a large number of threads over a substantial period. For example, when ebizzy is run for 60 seconds with 96 threads, and each thread processes between 5 to 6 million records, the total record count can easily surpass UINT_MAX. This would lead to an overflow. With these modifications, such situations are properly handled and reported.

Vishal Chourasia (2):
Enhanced thread safety in ebizzy benchmark tool Handle high record counts and prevent integer overflow

 utils/benchmark/ebizzy-0.3/ebizzy.c | 36 ++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 6 deletions(-)
Signature · 5 lines
2.39.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp