]> git.hungrycats.org Git - bees/commitdiff
hash: use kernel readahead instead of bees_readahead to prefetch hash table
authorZygo Blaxell <bees@furryterror.org>
Mon, 25 Nov 2024 03:11:42 +0000 (22:11 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 1 Dec 2024 04:30:33 +0000 (23:30 -0500)
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 <bees@furryterror.org>
src/bees-hash.cc

index 4877b7d441012623ba8b0a5f1e65e5e661b9b7b9..0ec092abe0653b134b031430eb40b799dad17ed1 100644 (file)
@@ -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);
                }
        });
 }