On 04.04.2012 11:17, Konstantin Belousov wrote:
> Calling madvise(MADV_RANDOM) fixes the issue, because the code to
> deactivate/cache the pages is turned off. On the other hand, it also
> turns of read-ahead for faulting, and the first loop becomes eternally
Now it takes 5 times longer. Anyway, thanks for explanation.
> Doing MADV_WILLNEED does not fix the problem indeed, since willneed
> reactivates the pages of the object at the time of call. To use
> MADV_WILLNEED, you would need to call it between faults/memcpy.
I played with it, but no luck so far.
>> I've also never seen super pages, how to make them work?
> They just work, at least for me. Look at the output of procstat -v
> after enough loops finished to not cause disk activity.
The problem was in my test program. I fixed it, now I see super pages
but I'm still not satisfied. There are several tests below: