stat/options patches
cover stat/options patches
From: Vincent Fu <[email protected]>
Jens, please consider these two patches that address a couple issues that we have encountered. Thanks.
Vincent
Vincent Fu (2):
stat: use long doubles to identify latency percentiles
options: catch division by zero in setting CPU affinity
options.c | 3 +++ stat.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
PATCH 1/2 stat: use long doubles to identify latency percentiles
From: Vincent Fu <[email protected]>
In some cases, the 100th percentile latency is not correctly identified because of problems with double precision floating point arithmetic. Use long doubles instead in the while loop condition to reduce the likelihood of encountering this problem.
Also, print an error message when latency percentiles are not successfully identified.
--- stat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
stat.c +4 -1
@@ -170,7 +170,7 @@ unsigned int calc_clat_percentiles(uint64_t *io_u_plat, unsigned long long nr, is_last = false;for (i =0 ; i <FIO_IO_U_PLAT_NR && !is_last; i++) { sum += io_u_plat[i]; -while (sum >= (plist[j].u.f /100.0 * nr)) { +while (sum >= ((long double ) plist[j].u.f /100.0 * nr)) {assert (plist[j].u.f <=100.0 ); ovals[j] =plat_idx_to_val (i);
@@ -187,6 +187,9 @@ unsigned int calc_clat_percentiles(uint64_t *io_u_plat, unsigned long long nr, } } +if (!is_last) +log_err ("fio: error calculating latency percentiles\n" ); + *output = ovals;return len; }
Signature · 1 line
2.17.1
PATCH 2/2 options: catch division by zero in setting CPU affinity
In reply to [email protected]From: Vincent Fu <[email protected]>
Catch a division by zero and abort with a helpful message instead of a signal 8 floating point error.
--- options.c | 3 +++ 1 file changed, 3 insertions(+)
options.c +3 -0
@@ -493,6 +493,9 @@ int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)const long max_cpu =cpus_online (); cpus_in_mask =fio_cpu_count (mask); +if (!cpus_in_mask) +return 0 ; + cpu_index = cpu_index % cpus_in_mask; index =0 ;
Signature · 1 line
2.17.1
Jens Axboe
AppliedQuoted 4 lines · On 2/19/19 2:44 PM, [email protected] wrote:
From: Vincent Fu <[email protected]>
Jens, please consider these two patches that address a couple issues that we have encountered. Thanks.
Applied, thanks Vincent.
Signature · 1 line
Jens Axboe