Share prefetch hit counter across slices/clones
Description
In the discussion in #14156 we found out:
Lucene’s MemorySegmentIndexInput uses a counter (consecutivePrefetchHitCount) to avoid repeated calls to isLoaded() and madviseWillNeed().
However every slice() or clone() resets it. This means prefetch suppression never converges, causing repeated expensive checks on the same underlying memory.
This issue tracks whether we should share the counter across slices/clones to make suppression effective.
Version and environment details
No response
I would like to work on this. I propose modifying MemorySegmentIndexInput to share the consecutivePrefetchHitCount state across slices and clones (likely via a shared mutable container) so that prefetch suppression converges correctly
Sorry @ML-dev-crypto, missed your comment, but feel free to review the PR: https://github.com/apache/lucene/pull/15585