All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/2] Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling
@ 2023-08-14  6:18 Vishal Chourasia
  2023-08-14  6:18 ` [LTP] [PATCH 1/2] Enhanced thread safety in ebizzy benchmark tool Vishal Chourasia
  2023-08-14  6:18 ` [LTP] [PATCH 2/2] Handle high record counts and prevent integer overflow Vishal Chourasia
  0 siblings, 2 replies; 6+ messages in thread
From: Vishal Chourasia @ 2023-08-14  6:18 UTC (permalink / raw)
  To: ltp, chris, chrubis, gaowanlong, pvorel, raj.khem, tdavies,
	vishalc

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(-)

-- 
2.39.3


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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [LTP] [PATCH 0/2] Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling
@ 2023-08-11 10:03 Vishal Chourasia
  2023-08-11 10:03 ` [LTP] [PATCH 1/2] Enhanced thread safety in ebizzy benchmark tool Vishal Chourasia
  0 siblings, 1 reply; 6+ messages in thread
From: Vishal Chourasia @ 2023-08-11 10:03 UTC (permalink / raw)
  To: ltp, chris, chrubis, gaowanlong, pvorel, raj.khem, tdavies,
	vishalc

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(-)

-- 
2.39.3


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-14 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14  6:18 [LTP] [PATCH 0/2] Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling Vishal Chourasia
2023-08-14  6:18 ` [LTP] [PATCH 1/2] Enhanced thread safety in ebizzy benchmark tool Vishal Chourasia
2023-08-14 15:15   ` Cyril Hrubis
2023-08-14 19:42     ` Vishal Chourasia
2023-08-14  6:18 ` [LTP] [PATCH 2/2] Handle high record counts and prevent integer overflow Vishal Chourasia
  -- strict thread matches above, loose matches on Subject: below --
2023-08-11 10:03 [LTP] [PATCH 0/2] Ebizzy Benchmark Tool: Enhancements for Thread Safety and Record Count Handling Vishal Chourasia
2023-08-11 10:03 ` [LTP] [PATCH 1/2] Enhanced thread safety in ebizzy benchmark tool Vishal Chourasia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.