linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Ying Han <yinghan@google.com>
Cc: linux-mm@kvack.org, aquini@redhat.com, hannes@cmpxchg.org,
	mhocko@suse.cz, Mel Gorman <mel@csn.ul.ie>
Subject: Re: [RFC][PATCH -mm -v2 3/4] mm,vmscan: reclaim from the highest score cgroups
Date: Fri, 17 Aug 2012 19:41:21 -0400	[thread overview]
Message-ID: <502ED6A1.9090201@redhat.com> (raw)
In-Reply-To: <CALWz4iz6QETaevrg4QAV390K=BXTQKdWfXb2_SOYj4eYWLxfAw@mail.gmail.com>

On 08/17/2012 07:34 PM, Ying Han wrote:
> On Thu, Aug 16, 2012 at 8:37 AM, Rik van Riel <riel@redhat.com> 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@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-08-17 23:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 15:34 [RFC][PATCH -mm -v2 0/4] mm,vmscan: reclaim from highest score cgroup Rik van Riel
2012-08-16 15:35 ` [RFC][PATCH -mm -v2 1/4] mm,vmscan: track recent pressure on each LRU set Rik van Riel
2012-08-16 15:36 ` [RFC][PATCH -mm -v2 2/4] mm,memcontrol: export mem_cgroup_get/put Rik van Riel
2012-08-16 15:37 ` [RFC][PATCH -mm -v2 3/4] mm,vmscan: reclaim from the highest score cgroups Rik van Riel
2012-08-17 23:34   ` Ying Han
2012-08-17 23:41     ` Rik van Riel [this message]
2012-08-18  0:26       ` Ying Han
2012-08-18  4:02         ` Rik van Riel
2012-08-16 15:38 ` [RFC][PATCH -mm -v2 4/4] mm,vmscan: evict inactive file pages first Rik van Riel
2012-08-23 23:07   ` Ying Han
2012-08-24  3:00     ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502ED6A1.9090201@redhat.com \
    --to=riel@redhat.com \
    --cc=aquini@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mhocko@suse.cz \
    --cc=yinghan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).