projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fio: fix cycles_start build issue
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index efbcea9eb15bb47dca4e0f802f85ad86197665de..f61fee8cb32240d2d85929eb0d131b009ec0d47d 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-68,6
+68,9
@@
static uint64_t last_block(struct thread_data *td, struct fio_file *f,
if (td->o.zone_range)
max_size = td->o.zone_range;
if (td->o.zone_range)
max_size = td->o.zone_range;
+ if (td->o.min_bs[ddir] > td->o.ba[ddir])
+ max_size -= td->o.min_bs[ddir] - td->o.ba[ddir];
+
max_blocks = max_size / (uint64_t) td->o.ba[ddir];
if (!max_blocks)
return 0;
max_blocks = max_size / (uint64_t) td->o.ba[ddir];
if (!max_blocks)
return 0;
@@
-100,6
+103,8
@@
static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
} else {
uint64_t off = 0;
} else {
uint64_t off = 0;
+ assert(fio_file_lfsr(f));
+
if (lfsr_next(&f->lfsr, &off))
return 1;
if (lfsr_next(&f->lfsr, &off))
return 1;
@@
-527,6
+532,12
@@
void io_u_quiesce(struct thread_data *td)
* io's that have been actually submitted to an async engine,
* and cur_depth is meaningless for sync engines.
*/
* io's that have been actually submitted to an async engine,
* and cur_depth is meaningless for sync engines.
*/
+ if (td->io_u_queued || td->cur_depth) {
+ int fio_unused ret;
+
+ ret = td_io_commit(td);
+ }
+
while (td->io_u_in_flight) {
int fio_unused ret;
while (td->io_u_in_flight) {
int fio_unused ret;
@@
-537,7
+548,6
@@
void io_u_quiesce(struct thread_data *td)
static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
{
enum fio_ddir odir = ddir ^ 1;
static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
{
enum fio_ddir odir = ddir ^ 1;
- struct timeval t;
long usec;
assert(ddir_rw(ddir));
long usec;
assert(ddir_rw(ddir));
@@
-572,9
+582,7
@@
static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
io_u_quiesce(td);
io_u_quiesce(td);
- fio_gettime(&t, NULL);
- usec_sleep(td, usec);
- usec = utime_since_now(&t);
+ usec = usec_sleep(td, usec);
td->rate_pending_usleep[ddir] -= usec;
td->rate_pending_usleep[ddir] -= usec;
@@
-1861,7
+1869,7
@@
void fill_io_buffer(struct thread_data *td, void *buf, unsigned int min_write,
{
struct thread_options *o = &td->o;
{
struct thread_options *o = &td->o;
- if (o->compress_percentage) {
+ if (o->compress_percentage
|| o->dedupe_percentage
) {
unsigned int perc = td->o.compress_percentage;
struct frand_state *rs;
unsigned int left = max_bs;
unsigned int perc = td->o.compress_percentage;
struct frand_state *rs;
unsigned int left = max_bs;