From cdcdf8e218edf1f49f249aaf980bf6127fb74428 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 24 Nov 2024 22:11:42 -0500 Subject: [PATCH] hash: use kernel readahead instead of bees_readahead to prefetch hash table The hash table is read sequentially and from a single thread, so the kernel's implementation of readahead is appropriate here. Signed-off-by: Zygo Blaxell --- src/bees-hash.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bees-hash.cc b/src/bees-hash.cc index 4877b7d..0ec092a 100644 --- a/src/bees-hash.cc +++ b/src/bees-hash.cc @@ -446,8 +446,8 @@ BeesHashTable::fetch_missing_extent_by_index(uint64_t extent_index) // If we are in prefetch, give the kernel a hint about the next extent if (m_prefetch_running) { - // XXX: don't call this if bees_readahead is implemented by pread() - bees_readahead(m_fd, dirty_extent_offset + dirty_extent_size, dirty_extent_size); + // Use the kernel readahead here, because it might work for this use case + readahead(m_fd, dirty_extent_offset + dirty_extent_size, dirty_extent_size); } }); }