projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
io_u: re-invalidate cache when looping around without file open/close
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 58c23202bd3d20bb1eee1b4fbcf1731d9bf312ea..4246edff0b2ffe19242dace14d4271ba851c7856 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-323,6
+323,17
@@
fetch:
goto fetch;
}
goto fetch;
}
+static void loop_cache_invalidate(struct thread_data *td, struct fio_file *f)
+{
+ struct thread_options *o = &td->o;
+
+ if (o->invalidate_cache && !o->odirect) {
+ int fio_unused ret;
+
+ ret = file_invalidate_cache(td, f);
+ }
+}
+
static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
enum fio_ddir ddir, uint64_t *b)
{
static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
enum fio_ddir ddir, uint64_t *b)
{
@@
-334,6
+345,7
@@
static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
fio_file_reset(td, f);
if (!get_next_rand_offset(td, f, ddir, b))
return 0;
fio_file_reset(td, f);
if (!get_next_rand_offset(td, f, ddir, b))
return 0;
+ loop_cache_invalidate(td, f);
}
dprint(FD_IO, "%s: rand offset failed, last=%llu, size=%llu\n",
}
dprint(FD_IO, "%s: rand offset failed, last=%llu, size=%llu\n",
@@
-358,6
+370,8
@@
static int get_next_seq_offset(struct thread_data *td, struct fio_file *f,
f->last_pos[ddir] = 0;
else
f->last_pos[ddir] = f->last_pos[ddir] - io_size;
f->last_pos[ddir] = 0;
else
f->last_pos[ddir] = f->last_pos[ddir] - io_size;
+
+ loop_cache_invalidate(td, f);
}
if (f->last_pos[ddir] < f->real_file_size) {
}
if (f->last_pos[ddir] < f->real_file_size) {
@@
-1779,7
+1793,7
@@
static void account_io_completion(struct thread_data *td, struct io_u *io_u,
if (td->parent)
td = td->parent;
if (td->parent)
td = td->parent;
- if (!td->o.stats)
+ if (!td->o.stats
|| td_ioengine_flagged(td, FIO_NOSTATS)
)
return;
if (no_reduce)
return;
if (no_reduce)