uschindler commented on code in PR #13381:
URL: https://github.com/apache/lucene/pull/13381#discussion_r1606106848
##########
lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -344,7 +354,11 @@ public void prefetch(long offset, long length) throws
IOException {
}
final MemorySegment prefetchSlice = segment.asSlice(offset, length);
- nativeAccess.madviseWillNeed(prefetchSlice);
+ if (nativeAccess.mincore(prefetchSlice) == false) {
Review Comment:
> Should we look into replacing our native code with a call to
`MemorySegment#load()` in a virtual thread?
Let's keep it with pure madvise. A virtual thread is not a good idea because
the "touch every page" code inside the JVM is not suitable for a virtual thread
as it is cpu bound.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]