On 12/17/2013 12:55 PM, Andrea Arcangeli wrote:
About creating heuristics to automatically detect the ideal value of the big-hammer per-app on/off switch (or even harder the ideal value of the per-app threshold), I think it's not going to happen because there are too few corner cases and it wouldn't be worth the cost of it (the cost would be significant no matter how implemented). Every time we try to make THP smarter at auto-disabling itself for the corner cases, we're slowing it down for everyone that gets a benefit from it, and there's no way around it. This is why I think the big-hammer prctl for the few corner cases is the best way to go.
There is one thing we could do in a slow path, that would result in automatic disabling of THP under the corner case of there not being enough memory in the system. We can teach the swapout code to discard zero-filled pages, instead of swapping them out to disk. That way we will "deflate" some of the excess memory consumed by THP, and reduce the extra swap IO that could be caused by THP using more memory. Not sure who is interested in this particular corner case, but it may be an interesting one to solve :) -- 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>