linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Roman Gushchin <guro@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>, Tejun Heo <tj@kernel.org>,
	Dennis Zhou <dennis@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH REBASED] mm, memcg: Make scan aggression always exclude protection
Date: Fri, 22 Mar 2019 22:49:46 +0000	[thread overview]
Message-ID: <20190322224946.GA12527@chrisdown.name> (raw)
In-Reply-To: <20190322222907.GA17496@tower.DHCP.thefacebook.com>

Roman Gushchin writes:
>I've noticed that the old version is just wrong: if cgroup_size is way smaller
>than max(min, low), scan will be set to -lruvec_size.
>Given that it's unsigned long, we'll end up with scanning the whole list
>(due to clamp() below).

Are you certain? If so, I don't see what you mean. This is how the code looks 
in Linus' tree after the fixups:

    unsigned long cgroup_size = mem_cgroup_size(memcg);
    unsigned long baseline = 0;

    if (!sc->memcg_low_reclaim)
            baseline = lruvec_size;
    scan = lruvec_size * cgroup_size / protection - baseline;

This works correctly as far as I can tell:

low reclaim case:

    In [1]: cgroup_size=50; lruvec_size=10; protection=2000; baseline=0; lruvec_size * cgroup_size // protection - baseline
    Out[1]: 0

normal case:

    In [2]: cgroup_size=3000; lruvec_size=10; protection=2000; baseline=lruvec_size; lruvec_size * cgroup_size // protection - baseline
    Out[2]: 5


  parent reply	other threads:[~2019-03-22 22:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 21:30 [PATCH] mm, memcg: Make scan aggression always exclude protection Chris Down
2019-03-01  0:03 ` Roman Gushchin
2019-03-22 16:03 ` [PATCH REBASED] " Chris Down
2019-03-22 20:10   ` Andrew Morton
2019-03-22 22:00     ` Chris Down
2019-03-22 22:29   ` Roman Gushchin
2019-03-22 22:49     ` Roman Gushchin
2019-03-22 22:51       ` Chris Down
2019-03-22 22:49     ` Chris Down [this message]
2019-03-22 23:01       ` Roman Gushchin
2019-03-22 23:51       ` Chris Down
2019-05-30  6:12   ` Michal Hocko
2019-05-30  6:44     ` Chris Down
2019-05-30  6:51       ` Michal Hocko
2019-05-30 20:52         ` Chris Down
2019-05-31  6:28           ` Michal Hocko
2019-05-31 19:27             ` Chris Down
2019-07-16 17:10   ` Johannes Weiner

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=20190322224946.GA12527@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=Kernel-team@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=dennis@kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=tj@kernel.org \
    /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).