[PATCH 2/2] Make read requests in IpcIo bypass max-swap-rate limit.

From: Dmitry Kurochkin <dmitry.kurochkin_at_measurement-factory.com>
Date: Thu, 13 Oct 2011 18:05:14 +0400

Before the change, IpcIoFile::WaitBeforePop() delayed both swap ins
(hits) and swap outs (misses). This is suboptimal because reads do
not usually accumulate unfinished I/O requests in OS buffers and,
hence, do not eventually require the OS to block all I/O.

Ideally, a disker should probably dequeue all pending disker requests,
satisfy reads ASAP, and then handle writes, but that is difficult for
several reasons. The patch implements a simpler approach: peek the
next request to be popped, and if it is a swap in (i.e., read or hit),
then pop it without any delay.

When a read is popped, we still adjust the balance member and LastIo,
because we do want to maintain the configured average I/O rate. When a
write request comes in, it will be delayed [longer] if needed.

In the extreme case of a very long stream of read requests (no writes
at all), there will be essentially no I/O rate limit and that is what
we want.

---
 src/DiskIO/IpcIo/IpcIoFile.cc |   13 ++++++++-----
 src/cf.data.pre               |    8 ++++++--
 src/ipc/Queue.cc              |   15 ---------------
 src/ipc/Queue.h               |   24 ++++++++++++++++++++++--
 4 files changed, 36 insertions(+), 24 deletions(-)

Received on Thu Oct 13 2011 - 14:05:37 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 28 2011 - 12:00:11 MDT