projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'gfio' of ssh://brick.kernel.dk/data/git/fio into gfio
[fio.git]
/
backend.c
diff --git
a/backend.c
b/backend.c
index 3600319b233fb923fd214bea4179d436ae0f0f0e..3a1df299fd80f920ee97d8f1ecb79b525726a838 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-67,6
+67,7
@@
unsigned int thread_number = 0;
int shm_id = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
int shm_id = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
+volatile int disk_util_exit = 0;
#define PAGE_ALIGN(buf) \
(char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
#define PAGE_ALIGN(buf) \
(char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
@@
-802,6
+803,7
@@
static int init_io_u(struct thread_data *td)
struct io_u *io_u;
unsigned int max_bs, min_write;
int cl_align, i, max_units;
struct io_u *io_u;
unsigned int max_bs, min_write;
int cl_align, i, max_units;
+ int data_xfer = 1;
char *p;
max_units = td->o.iodepth;
char *p;
max_units = td->o.iodepth;
@@
-811,6
+813,9
@@
static int init_io_u(struct thread_data *td)
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;
+ if ((td->io_ops->flags & FIO_NOIO) || !(td_read(td) || td_write(td)))
+ data_xfer = 0;
+
if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
unsigned long bs;
if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
unsigned long bs;
@@
-823,7
+828,7
@@
static int init_io_u(struct thread_data *td)
return 1;
}
return 1;
}
- if (allocate_io_mem(td))
+ if (
data_xfer &&
allocate_io_mem(td))
return 1;
if (td->o.odirect || td->o.mem_align ||
return 1;
if (td->o.odirect || td->o.mem_align ||
@@
-851,7
+856,7
@@
static int init_io_u(struct thread_data *td)
INIT_FLIST_HEAD(&io_u->list);
dprint(FD_MEM, "io_u alloc %p, index %u\n", io_u, i);
INIT_FLIST_HEAD(&io_u->list);
dprint(FD_MEM, "io_u alloc %p, index %u\n", io_u, i);
- if (
!(td->io_ops->flags & FIO_NOIO)
) {
+ if (
data_xfer
) {
io_u->buf = p;
dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);
io_u->buf = p;
dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);
@@
-1617,6
+1622,13
@@
void wait_for_disk_thread_exit(void)
fio_mutex_down(disk_thread_mutex);
}
fio_mutex_down(disk_thread_mutex);
}
+static void free_disk_util(void)
+{
+ disk_util_start_exit();
+ wait_for_disk_thread_exit();
+ disk_util_prune_entries();
+}
+
static void *disk_thread_main(void *data)
{
int ret = 0;
static void *disk_thread_main(void *data)
{
int ret = 0;