The client was using the configured maximum readahead of 0 which was changed in
95ee69989129750fddce6a3b5644238c4b88ed74. This prevented readahead from ever
running (without setting a different default from 0).
Fixes: http://tracker.ceph.com/issues/16024
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
01c179bcce2dc8a269d78eb1be8198b12bd161f7)
Signed-off-by: Greg Farnum <gfarnum@redhat.com
len = in->size - off;
}
- ldout(cct, 10) << " max_bytes=" << conf->client_readahead_max_bytes
- << " max_periods=" << conf->client_readahead_max_periods << dendl;
+ ldout(cct, 10) << " min_bytes=" << f->readahead.get_min_readahead_size()
+ << " max_bytes=" << f->readahead.get_max_readahead_size()
+ << " max_periods=" << conf->client_readahead_max_periods << dendl;
// read (and possibly block)
int r, rvalue = 0;
delete onfinish;
}
- if(conf->client_readahead_max_bytes > 0) {
+ if(f->readahead.get_min_readahead_size() > 0) {
pair<uint64_t, uint64_t> readahead_extent = f->readahead.update(off, len, in->size);
if (readahead_extent.second > 0) {
ldout(cct, 20) << "readahead " << readahead_extent.first << "~" << readahead_extent.second
m_lock.Unlock();
}
+uint64_t Readahead::get_min_readahead_size(void) {
+ Mutex::Locker lock(m_lock);
+ return m_readahead_min_bytes;
+}
+
+uint64_t Readahead::get_max_readahead_size(void) {
+ Mutex::Locker lock(m_lock);
+ return m_readahead_max_bytes;
+}
+
void Readahead::set_min_readahead_size(uint64_t min_readahead_size) {
m_lock.Lock();
m_readahead_min_bytes = min_readahead_size;
*/
void set_trigger_requests(int trigger_requests);
+ /**
+ Gets the minimum size of a readahead request, in bytes.
+ */
+ uint64_t get_min_readahead_size(void);
+
+ /**
+ Gets the maximum size of a readahead request, in bytes.
+ */
+ uint64_t get_max_readahead_size(void);
+
/**
Sets the minimum size of a readahead request, in bytes.
*/