From: Jens Axboe Date: Fri, 27 Oct 2006 09:30:07 +0000 (+0200) Subject: [PATCH cpu io threads need not have lots of stuff setup X-Git-Tag: fio-1.8~32 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f48b467cba78af0843c7320caf841e2bee72fb1e;p=fio.git [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 --- 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)