Re: [RFC PATCH 0/3] Change how we determine when to hand out THPs

From: Rik van Riel
Date: Wed Dec 18 2013 - 14:07:51 EST


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/