Re: [RFC][PATCH -mm -v2 3/4] mm,vmscan: reclaim from the highest score cgroups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/17/2012 07:34 PM, Ying Han wrote:
On Thu, Aug 16, 2012 at 8:37 AM, Rik van Riel <riel@xxxxxxxxxx> wrote:

+       /*
+        * Reclaim from the top scoring lruvec until we freed enough
+        * pages, or its reclaim priority has halved.
+        */
+       do {
+               shrink_lruvec(victim_lruvec, sc);
+               score = reclaim_score(memcg, victim_lruvec);
+       } while (sc->nr_to_reclaim > 0 && score > max_score / 2);

This would violate the user expectation of soft_limit badly,
especially for background reclaim where nr_to_reclaim equals to
ULONG_MAX.

Here we keep hitting cgroup A and potentially push it down to
softlimit until the score drops to certain level. It is bad since it
causes "hot" memory (under softlimit) of A being reclaimed while other
cgroups has plenty of "cold" (above softlimit) to give out.

Look at the function reclaim_score().

Once a group drops below its soft limit, its score will
be a factor 10000 smaller, making sure we hit the second
exit condition.

After that, we will pick another group.

In general, pick one cgroup to reclaim instead of round-robin is ok as
long as we don't reclaim further down to the softlimit. The next
question then is what's the next cgroup to reclaim if that doesn't
give us enough.

Again, look at the function reclaim_score().

If there is a group above the softlimit, we pretty much
guarantee we will reclaim from that group.  If any reclaim
will happen from another group, it will be absolutely
minimal (taking recent_pressure from 0 to SWAP_CLUSTER_MAX,
and then moving on to another group).

--
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>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]