[PATCH] Account for max-swap-rate in swap-timeout handling for Rock.

From: Dmitry Kurochkin <dmitry.kurochkin_at_measurement-factory.com>
Date: Fri, 7 Oct 2011 05:25:32 +0400

Current swap-timeout code does not know about max-swap-rate. It
simply finds the longest-waiting I/O in disker queues (incoming and
outgoing) and then assumes that the new I/O will wait at least that
long. The assumption is likely to be wrong when the queue contains
lots of freshly queued requests to disker: Those requests have not
waited long yet, but a max-swap-rate limit will slow them down
shortly.

The patch changes the swap-timeout code to account for max-swap-rate
when dealing with the workers-to-disker queue: If there are N requests
pending, the new one will wait at least N/max-swap-rate seconds. Also
expected wait time is adjusted based on the queue "balance" member, in
case we have been borrowing time against future I/O already.

---
 src/DiskIO/IpcIo/IpcIoFile.cc |   16 +++++++++++++++-
 src/ipc/Queue.cc              |   30 ++++++++++++++++++++++++++++++
 src/ipc/Queue.h               |   28 ++++++++++++++++++++++------
 3 files changed, 67 insertions(+), 7 deletions(-)

Received on Fri Oct 07 2011 - 01:25:45 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 14 2011 - 12:00:15 MDT