projects
/
disktools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5de35d
)
[PATCH] fio: for mmap'ed io with the direct option, sync after each copy
author
Jens Axboe
<axboe@suse.de>
Fri, 18 Nov 2005 10:01:35 +0000
(11:01 +0100)
committer
Jens Axboe
<axboe@suse.de>
Fri, 18 Nov 2005 10:01:35 +0000
(11:01 +0100)
fio.c
patch
|
blob
|
blame
|
history
diff --git
a/fio.c
b/fio.c
index baf50f4c6fd0182886f32431d4e4411dc3c3b347..c46b5ac386081c44490504475a1813f93148ec47 100644
(file)
--- a/
fio.c
+++ b/
fio.c
@@
-700,6
+700,14
@@
static int __do_sync_mmap(struct thread_data *td, struct io_u *io_u)
memcpy(io_u->buf, td->mmap + real_off, io_u->buflen);
else
memcpy(td->mmap + real_off, io_u->buf, io_u->buflen);
+
+ /*
+ * not really direct, but should drop the pages from the cache
+ */
+ if (td->odirect) {
+ msync(td->mmap + real_off, io_u->buflen, MS_SYNC);
+ madvise(td->mmap + real_off, io_u->buflen, MADV_DONTNEED);
+ }
return io_u->buflen;
}