From f48b467cba78af0843c7320caf841e2bee72fb1e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 27 Oct 2006 11:30:07 +0200 Subject: [PATCH] [PATCH cpu io threads need not have lots of stuff setup Everything that has to do with io can be skipped. Signed-off-by: Jens Axboe --- fio.c | 3 +++ init.c | 3 +++ log.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/fio.c b/fio.c index 234822ee..81e9e90d 100644 --- a/fio.c +++ b/fio.c @@ -518,6 +518,9 @@ static int switch_ioscheduler(struct thread_data *td) FILE *f; int ret; + if (td->io_ops->flags & FIO_CPUIO) + return 0; + sprintf(tmp, "%s/queue/scheduler", td->sysfs_root); f = fopen(tmp, "r+"); diff --git a/init.c b/init.c index f27fdf1f..b0c35f10 100644 --- a/init.c +++ b/init.c @@ -604,6 +604,9 @@ int init_random_state(struct thread_data *td) int fd, num_maps, blocks, i; struct fio_file *f; + if (td->io_ops->flags & FIO_CPUIO) + return 0; + fd = open("/dev/urandom", O_RDONLY); if (fd == -1) { td_verror(td, errno); diff --git a/log.c b/log.c index 13435560..b1511647 100644 --- a/log.c +++ b/log.c @@ -172,6 +172,9 @@ int init_iolog(struct thread_data *td) { int ret = 0; + if (td->io_ops->flags & FIO_CPUIO) + return 0; + if (td->read_iolog_file) ret = init_iolog_read(td); else if (td->write_iolog_file) -- 2.25.1