]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/FileJournal: fix aio self-throttling deadlock
authorSage Weil <sage@inktank.com>
Tue, 19 Mar 2013 21:26:16 +0000 (14:26 -0700)
committerSage Weil <sage@inktank.com>
Sat, 23 Mar 2013 00:46:04 +0000 (17:46 -0700)
commit3569489b541ac0643520d20b08c788c26dfaff7f
tree312546a51a63b059f2835abad237c27005e9e298
parent664ffa7d2178e486b00fa0706067f19b1bb9ab82
os/FileJournal: fix aio self-throttling deadlock

This block of code tries to limit the number of aios in flight by waiting
for the amount of data to be written to grow relative to a function of the
number of aios.  Strictly speaking, the condition we are waiting for is a
function of both aio_num and the write queue, but we are only woken by
changes in aio_num, and were (in rare cases) waiting when aio_num == 0 and
there was no possibility of being woken.

Fix this by verifying that aio_num > 0, and restructuring the loop to
recheck that condition on each wakeup.

Fixes: #4079
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit e5940da9a534821d0d8f872c13f9ac26fb05a0f5)
src/os/FileJournal.cc