From: Pan Liu Date: Fri, 28 Apr 2017 03:36:46 +0000 (+0800) Subject: os/filestore: use new sleep strategy when io_submit gets EAGAIN. X-Git-Tag: v12.0.3~173^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e47403bfb3058c37969d49a5e045ccf55259dce;p=ceph.git os/filestore: use new sleep strategy when io_submit gets EAGAIN. Signed-off-by: Pan Liu --- diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index 9956a1f213b4..1e14ca81b476 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -1410,7 +1410,10 @@ int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq) aio_lock.Unlock(); iocb *piocb = &aio.iocb; - int attempts = 10; + + // 2^16 * 125us = ~8 seconds, so max sleep is ~16 seconds + int attempts = 16; + int delay = 125; do { int r = io_submit(aio_ctx, 1, &piocb); dout(20) << "write_aio_bl io_submit return value: " << r << dendl; @@ -1418,7 +1421,8 @@ int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq) derr << "io_submit to " << aio.off << "~" << cur_len << " got " << cpp_strerror(r) << dendl; if (r == -EAGAIN && attempts-- > 0) { - usleep(500); + usleep(delay); + delay *= 2; continue; } check_align(pos, tbl);