From: Sage Weil Date: Wed, 6 Jan 2016 19:19:54 +0000 (-0500) Subject: os/fs: make aio EAGAIN backoff exponential X-Git-Tag: v10.0.3~88^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b0bd24843577aef2b806bc1ee2b573deeda11cb3;p=ceph.git os/fs: make aio EAGAIN backoff exponential Signed-off-by: Sage Weil --- diff --git a/src/os/fs/FS.h b/src/os/fs/FS.h index ec0376e4fb3..3941799398e 100644 --- a/src/os/fs/FS.h +++ b/src/os/fs/FS.h @@ -110,13 +110,16 @@ public: } int submit(aio_t &aio, int *retries) { - int attempts = 10; + // 2^16 * 125us = ~8 seconds, so max sleep is ~16 seconds + int attempts = 16; + int delay = 125; iocb *piocb = &aio.iocb; while (true) { int r = io_submit(ctx, 1, &piocb); if (r < 0) { if (r == -EAGAIN && attempts-- > 0) { - usleep(500); + usleep(delay); + delay *= 2; (*retries)++; continue; }