Skip to contentSkip to conversation

reporting two fio bug fix when ramp_time / rate_iops options is specified

PATCH SEOKYOUNG KO 2 participants 2 messages Mar 7, 2013

lore
Share & tools
lore
#0 lore raw

hi.
we detected two problems related to logging latencies. then we have analyzed the problems and fixed some fio codes.

(0) test condition
- kernel 3.0.0
- fio 2.0.13
- fio --filename=/dev/sdb1 --ioengine=libaio --direct=1 --norandommap --randrepeat=0 --time_based --runtime=$RUNTIME --blocksize=4k --rw=randrw

    --rwmixwrite=66 --iodepth=8 --overwrite=1 --refill_buffers

- additional parameter: -ramp_time=$RAMP_TIME / -rate_iops=75% of avg.iops.
- test on a latest SSD

(1) -ramp_time option
■ Problem Statement
- When –ramp_time option is specified, it is reported that latency distribution (xx.xx% latencies) is negatively affected (higher WRITE latency for mixed 66:33 R/W)

■ Analysis Result 1 - Comparison Experiment
- w/o –ramp_time, FIO generates uniformly mixed R/W workload, as expected
- w/ –ramp_time , FIO shows abnormal behavior of generating burst WRITE workloads, when it gets out of‘ramping-up stage’
- Because of the WRITE burst, FIO logs get contaminated by lots of long-latency samples ==> False report of worse latency distribution

■ Analysis Result 2 - Code inspection
- when -ramp_time option is specified, fio call reset_all_stats() after fio run for the ramp_time.
- but there is a bug that td->rwmix_issues is not reset in reset_all_stats()
- when fio perform rwmix workload, fio compare td->io_issues to td->rwmix_issues in order to select the next io direction.
- if td->rwmix_issues is not reset (original code), fio will run the workload of same io direction until td->io_issues < td->rwmix_issues after ramp_time is end.

■ Patch

libfio.c 2013-03-04 11:03:46.048422630 +0900 renamed from libfio.c 2013-03-04 11:01:59.012419225 +0900 +1 -0
@@ -116,6 +116,7 @@ 
   td->io_issues[i] = 0; 
   td->ts.total_io_u[i] = 0; 
   td->ts.runtime[i] = 0; 
+  td->rwmix_issues = 0; 
  } 
  
  fio_gettime(&tv, NULL); 

(2) -rate_iops option
■ Problem Statement
- When –rate_iops option is specified, it is reported that latency distribution is negatively affected (higher WRITE latency for mixed 66:33 R/W)

■ Analysis Result 1 - Comparison Experiment
- We have compared the logging report from FIO against the report from BLKTRACE => Observation : FIO falsely reported much higher I/O latency than BLCKTRACE

■ Analysis Result 2 – FIO code inspection
- when -rate_iops is specified, FIO periodically calls usleep() to limit IOPS
- Before usleep(), FIO always wait until the completion of all pending I/O
- For all I/O completions, FIO shows erroneous behavior of logging their latency, with that of the longest latency IO sample
- w/ QD=8/ mixed R:W=33:66, up to 7 samples may get false latency log when waiting all I/O completions => False report of latency distribution

■ Patch

io_u.c 2013-03-04 11:05:32.828426032 +0900 renamed from io_u.c 2013-03-04 11:01:59.008419251 +0900 +2 -2
@@ -457,10 +457,10 @@ 
   * io's that have been actually submitted to an async engine, 
   * and cur_depth is meaningless for sync engines. 
   */ 
- if (td->io_u_in_flight) { 
+ while (td->io_u_in_flight) { 
   int fio_unused ret; 
  
-  ret = io_u_queued_complete(td, td->io_u_in_flight, NULL); 
+  ret = io_u_queued_complete(td, 1, NULL); 
  } 
 
  fio_gettime(&t, NULL); 
#1 lore raw
Quoted 3 lines · SEOKYOUNG KO

hi.
we detected two problems related to logging latencies. then we have analyzed the problems and fixed some fio codes.

Thanks for the detailed analysis (and fixes!), I have applied both patches.

Signature · 1 line
Jens Axboe