On 09/04/2012 03:34 AM, Konstantin Khlebnikov wrote:
It disables reahahead if it is ineffective in one particular VMA, but in recovering-case this does not important -- we really want to read whole swap back, no matter which VMA around pages belongs to. [BTW this case was mentioned in you patch which added skipping-over-holes]
This is a good point. It is entirely possible that we may be better off deciding this on a system wide level, and not a VMA level, since that would allow for the statistic to move faster. On the other hand, keeping readahead enabled for some VMAs at any times may be required to get the hits we need to re-enable it for others :)
And its metric is strange, looks like it just disables headahead for all VMAs after hundred swapins and never enables it back. Why we cannot disable it from the beginning and turn it on when needed? This ways is even more simple.
Take a careful look at the code, specifically do_swap_page(). If a page is found in the swap cache, it is counted as a hit. If enough pages are found in the swap cache, readahead is enabled again for the VMA. Having swap readahead enabled by default is probably the best thing to do, since IO clustering is generally useful. How would you determine when to "turn it on when needed"? What kind of criteria would you use? What would be the threshold for enabling it? -- All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>