On Sat, Mar 13, 2021 at 01:16:48PM +0000, Mel Gorman wrote:
quoted
I'm not claiming the pagevec is definitely a win, but it's very
unclear which tradeoff is actually going to lead to better performance.
Hopefully Jesper or Chuck can do some tests and figure out what actually
works better with their hardware & usage patterns.
The NFS user is often going to need to make round trips to get the pages it
needs. The pagevec would have to be copied into the target array meaning
it's not much better than a list manipulation.
I don't think you fully realise how bad CPUs are at list manipulation.
See the attached program (and run it on your own hardware). On my
less-than-a-year-old core-i7:
$ gcc -W -Wall -O2 -g array-vs-list.c -o array-vs-list
$ ./array-vs-list
walked sequential array in 0.001765s
walked sequential list in 0.002920s
walked sequential array in 0.001777s
walked shuffled list in 0.081955s
walked shuffled array in 0.007367s
If you happen to get the objects in-order, it's only 64% worse to walk
a list as an array. If they're out of order, it's *11.1* times as bad.