From: Davide Libenzi Date: Mon, 26 Mar 2007 10:20:49 +0000 (+0200) Subject: GUASI update X-Git-Tag: fio-1.15~36 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=97c26cbe7f73f423ee8feceb9ec4369bfe442646 GUASI update The GUASI library has been changed to avoid using pthread defaults stacks (that burns 8MB of VM area for each thread). Also, a new paramter has been added to guasi_create(), to allow the caller to specify a stack size. I noticed a different behaviour of FIO in randrw mode, from GUASI to libaio. In GUASI, the amount of data read is about the same +-2-3% of the amount of data written. Whereas in libaio, there can be a huge difference between the two (up to 2-3 times the other). This is consistent. Besides that, GUASI performance follows pretty much the libaio one, up to an io-depth of 1000-1500, after that shows about 10-15% less performance. Signed-off-by: Jens Axboe --- diff --git a/engines/guasi.c b/engines/guasi.c index 34b42e71..925c364a 100644 --- a/engines/guasi.c +++ b/engines/guasi.c @@ -26,7 +26,7 @@ #define GFIO_MIN_THREADS 32 #ifndef GFIO_MAX_THREADS -#define GFIO_MAX_THREADS 280 +#define GFIO_MAX_THREADS 2000 #endif #include @@ -108,9 +108,12 @@ static int fio_guasi_getevents(struct thread_data *td, int min, int max, guasi_req_free(ld->reqs[n]); n = 0; do { - r = guasi_fetch(ld->hctx, ld->reqs + n, max - n, timeo); - if (r < 0) + r = guasi_fetch(ld->hctx, ld->reqs + n, min - n, + max - n, timeo); + if (r < 0) { + fprintf(stderr, "guasi_fetch() FAILED! (%d)\n", r); break; + } n += r; if (n >= min) break; @@ -134,15 +137,18 @@ static int fio_guasi_queue(struct thread_data *td, struct io_u *io_u) return FIO_Q_QUEUED; } -static void fio_guasi_queued(struct thread_data *td, struct io_u **io_us, - unsigned int nr) +static void fio_guasi_queued(struct thread_data *td, struct io_u **io_us, int nr) { + int i; + struct io_u *io_u; struct timeval now; - struct io_u *io_u = io_us[nr]; fio_gettime(&now, NULL); - memcpy(&io_u->issue_time, &now, sizeof(now)); - io_u_queued(td, io_u); + for (i = 0; i < nr; i++) { + io_u = io_us[i]; + memcpy(&io_u->issue_time, &now, sizeof(now)); + io_u_queued(td, io_u); + } } static int fio_guasi_commit(struct thread_data *td) @@ -172,14 +178,13 @@ static int fio_guasi_commit(struct thread_data *td) fprintf(stderr, "fio_guasi_commit() FAILED: unknow request %d\n", io_u->ddir); } - if (io_u->greq != NULL) - fio_guasi_queued(td, ld->io_us, i); - else { + if (io_u->greq == NULL) { fprintf(stderr, "fio_guasi_commit() FAILED: submit failed (%s)\n", strerror(errno)); return -1; } } + fio_guasi_queued(td, ld->io_us, i); ld->queued_nr = 0; GDBG_PRINT(("fio_guasi_commit() -> %d\n", i)); @@ -223,7 +228,7 @@ static int fio_guasi_init(struct thread_data *td) maxthr = td->o.iodepth > GFIO_MIN_THREADS ? td->o.iodepth: GFIO_MIN_THREADS; if (maxthr > GFIO_MAX_THREADS) maxthr = GFIO_MAX_THREADS; - if ((ld->hctx = guasi_create(GFIO_MIN_THREADS, maxthr, 1)) == NULL) { + if ((ld->hctx = guasi_create(GFIO_MIN_THREADS, maxthr, 1, 0)) == NULL) { td_verror(td, errno, "guasi_create"); free(ld); return 1;