From: Zhiqiang Wang Date: Tue, 7 Apr 2015 05:43:36 +0000 (+0800) Subject: librbd: start readahead from m_last_pos when the size of the continuing X-Git-Tag: v9.0.0~19^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=04fe26921fd2900e9cfa7f6b6fe78d91291311e0;p=ceph.git librbd: start readahead from m_last_pos when the size of the continuing triggering request is big enough If the size of the read triggering the continuing readahead is such big that exceeding m_readahead_pos, should do the readahead starting from m_last_pos. Signed-off-by: Zhiqiang Wang --- diff --git a/src/common/Readahead.cc b/src/common/Readahead.cc index a3f5bfc7e4e7..77ab92eba4ff 100644 --- a/src/common/Readahead.cc +++ b/src/common/Readahead.cc @@ -70,6 +70,9 @@ Readahead::extent_t Readahead::_compute_readahead(uint64_t limit) { } else { // continuing readahead trigger m_readahead_size *= 2; + if (m_last_pos > m_readahead_pos) { + m_readahead_pos = m_last_pos; + } } m_readahead_size = MAX(m_readahead_size, m_readahead_min_bytes); m_readahead_size = MIN(m_readahead_size, m_readahead_max_bytes);