Thank
you for your reply. shrink_lruvec() is nested in deep loop. Reclaimer may have already reclaimed part of requested memory in one loop, but before adjust sc->nr_to_reclaim in outer loop, call shrink_lruvec() again will still follow the current sc->nr_to_reclaim
to work. It will eventually lead to overreclaim.
Problematic
case is easy to be constructed. Allocate lots of anonymous memory(e.g. 20G) in a memcg, then swapping by writing memory.reclaim and there
is a certain probability of overreclaim.
(Sorry
to find out that there was a problem with the format of the previous reply. Thanks again.)
|