On Fri, Apr 14, 2023 at 10:47:39PM +0200, Bernd Schubert wrote: > > Up to bs=512K it works fine, 1M (and for what it matters > > already 768K) introduce the order=0 issue. > > Hmm, I replaced memcpy with dumb version, that copies byte by byte - problem > gone. Is it possible that the optimized memcpy causes caused kind of random > memory access and confuses mm / readahead? > And somehow your memcpy or system is not doing that? Oh, that would make sense! If the memcpy() works high-to-low, then you'd see exactly the behaviour you're reporting. Whereas low-to-high results in the behaviour I'm seeing. Hm. I don't know what to do about that. Maybe a "sufficiently large" memcpy should call posix_madvise(src, n, POSIX_MADV_WILLNEED)