projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
io_u: we don't need to set power_2 to false
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 69bec4bf4bcf83d57d1edf40e63c0a34f912bd02..5f01c1b674ebecd8612c9681411dc9773dd5a493 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-62,6
+62,7
@@
static uint64_t last_block(struct thread_data *td, struct fio_file *f,
/*
* Hmm, should we make sure that ->io_size <= ->real_file_size?
/*
* Hmm, should we make sure that ->io_size <= ->real_file_size?
+ * -> not for now since there is code assuming it could go either.
*/
max_size = f->io_size;
if (max_size > f->real_file_size)
*/
max_size = f->io_size;
if (max_size > f->real_file_size)
@@
-532,6
+533,7
@@
static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
unsigned int buflen = 0;
unsigned int minbs, maxbs;
uint64_t frand_max, r;
unsigned int buflen = 0;
unsigned int minbs, maxbs;
uint64_t frand_max, r;
+ bool power_2;
assert(ddir_rw(ddir));
assert(ddir_rw(ddir));
@@
-576,9
+578,11
@@
static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
}
}
}
}
- if (!td->o.bs_unaligned && is_power_of_2(minbs))
+ power_2 = is_power_of_2(minbs);
+ if (!td->o.bs_unaligned && power_2)
buflen &= ~(minbs - 1);
buflen &= ~(minbs - 1);
-
+ else if (!td->o.bs_unaligned && !power_2)
+ buflen -= buflen % minbs;
} while (!io_u_fits(td, io_u, buflen));
return buflen;
} while (!io_u_fits(td, io_u, buflen));
return buflen;
@@
-642,7
+646,7
@@
int io_u_quiesce(struct thread_data *td)
}
while (td->io_u_in_flight) {
}
while (td->io_u_in_flight) {
- int
fio_unused
ret;
+ int ret;
ret = io_u_queued_complete(td, 1);
if (ret > 0)
ret = io_u_queued_complete(td, 1);
if (ret > 0)
@@
-1733,6
+1737,9
@@
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)
+ return;
+
if (no_reduce)
lusec = utime_since(&io_u->issue_time, &icd->time);
if (no_reduce)
lusec = utime_since(&io_u->issue_time, &icd->time);
@@
-1959,7
+1966,7
@@
int io_u_queued_complete(struct thread_data *td, int min_evts)
int ret, ddir;
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };
int ret, ddir;
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };
- dprint(FD_IO, "io_u_queued_complete
d
: min=%d\n", min_evts);
+ dprint(FD_IO, "io_u_queued_complete: min=%d\n", min_evts);
if (!min_evts)
tvp = &ts;
if (!min_evts)
tvp = &ts;
@@
-1993,7
+2000,7
@@
int io_u_queued_complete(struct thread_data *td, int min_evts)
*/
void io_u_queued(struct thread_data *td, struct io_u *io_u)
{
*/
void io_u_queued(struct thread_data *td, struct io_u *io_u)
{
- if (!td->o.disable_slat) {
+ if (!td->o.disable_slat
&& ramp_time_over(td) && td->o.stats
) {
unsigned long slat_time;
slat_time = utime_since(&io_u->start_time, &io_u->issue_time);
unsigned long slat_time;
slat_time = utime_since(&io_u->start_time, &io_u->issue_time);