loader: Only trigger read-ahead if two adjacent blocks have been requested.
Picked from FreeBSD:
Author: Maxim Sobolev <sobomax@FreeBSD.org>
The change makes block caching algorithm to work better for remote media on low-BW/high-delay links. This cuts boot time over IP KVMs noticeably, since the initialization stage reads bunch of small 4th (and now lua) files that are not in the same cache stripe (usually), thus wasting lot of bandwidth and increasing latency even further. The original regression came in 2017 with revision 87ed2b7f5. We've seen increase of time it takes for the loader to get to the kernel loading from under a minute to 10-15 minutes in many cases.
Differential Revision: https://reviews.freebsd.org/D31623