That patch still exits after 5127 ios. io_bytes_exceeded is called 5128 times, but it sees td->io_u_queued=0 each time. keep_running makes it to the if (td->o.number_ios) branch one time, and sees number_ios set to 5127 and td->o.number_ios set to 5000 (causing it to return 0 and trigger the end, after 5127 ios). > -----Original Message----- > From: Jens Axboe [mailto:axboe@xxxxxxxxx] > Sent: Tuesday, 11 March, 2014 10:36 AM > To: Elliott, Robert (Server Storage); fio@xxxxxxxxxxxxxxx > Subject: Re: number_ios is checked on completion, not submission > > On 03/10/2014 03:12 PM, Elliott, Robert (Server Storage) wrote: > > Since number_ios is checked in io_u.c account_io_completion() rather than > a submission function, fio actually runs the requested number of I/Os plus > iodepth - 1. > > > > Example: for a job specifying: > > number_ios=5000 > > iodepth=128 > > > > the results are: > > read : io=20000KB, bw=222222KB/s, iops=56966, runt= 90msec > > IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.2%, 16=0.3%, 32=0.6%, > >=64=98.8% > > issued : total=r=5127/w=0/d=0, short=r=0/w=0/d=0 > > > > Should that just be documented as such, or should this logic be moved to > submission? > > static void account_io_completion(struct thread_data *td, struct io_u > *io_u, > > ... > > if (td->o.number_ios && !--td->o.number_ios) > > td->done = 1; > > Can you try the attached patch and see if that makes it behave more like > expected? > > -- > Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html