From 444000faf10a67b3654e6f6f984de9ee463af1d3 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 26 Dec 2018 15:41:12 -0800 Subject: [PATCH] ircd::fs: Add a nodelay option on reads. --- include/ircd/fs/read.h | 5 +++++ ircd/aio.cc | 1 + 2 files changed, 6 insertions(+) diff --git a/include/ircd/fs/read.h b/include/ircd/fs/read.h index f4b1bf211..31f9f76f9 100644 --- a/include/ircd/fs/read.h +++ b/include/ircd/fs/read.h @@ -63,6 +63,11 @@ struct ircd::fs::read_opts /// an exception will be thrown. We default to true because we have faith /// in the useful propagation of an exception for this event. bool interruptible {true}; + + /// Submits the I/O request immediately rather than allowing IRCd to + /// queue requests for a few iterations of the ircd::ios event loop. + /// (only relevant to aio). + bool nodelay {false}; }; inline diff --git a/ircd/aio.cc b/ircd/aio.cc index 42752c22c..9e07cdd39 100644 --- a/ircd/aio.cc +++ b/ircd/aio.cc @@ -503,6 +503,7 @@ noexcept try // non-reading events, even for different files and locations. It may // be possible to optimize this condition. || request.aio_lio_opcode != IOCB_CMD_PREADV + || request.ropts->nodelay }; if(flush_now)