From: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
To: Roman Gushchin <klamm-XoJtRXgx1JseBXzfvpsJ4g@public.gmane.org>
Cc: Johannes Weiner-Arquette
<hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
"bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org"
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
"akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org"
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
"kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org"
<kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
Rik van Riel <riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"mel-wPRd99KPJ+uzQB+pC5nmwQ@public.gmane.org"
<mel-wPRd99KPJ+uzQB+pC5nmwQ@public.gmane.org>,
"gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org"
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
Ying Han <yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] memcg: implement low limits
Date: Thu, 28 Feb 2013 15:30:52 +0100 [thread overview]
Message-ID: <20130228143052.GE6573@dhcp22.suse.cz> (raw)
In-Reply-To: <38951361977052-uV6RMHoE7x/0t1ZyImeKKJZIWCK8hONu@public.gmane.org>
On Wed 27-02-13 18:57:32, Roman Gushchin wrote:
[...]
> >> + *
> >> + */
> >> +unsigned int mem_cgroup_low_limit_scale(struct lruvec *lruvec)
> >> +{
> >> + struct mem_cgroup_per_zone *mz;
> >> + struct mem_cgroup *memcg;
> >> + unsigned long long low_limit;
> >> + unsigned long long usage;
> >> + unsigned int i;
> >> +
> >> + mz = container_of(lruvec, struct mem_cgroup_per_zone, lruvec);
> >> + memcg = mz->memcg;
> >> + if (!memcg)
> >> + return 0;
> >> +
> >> + low_limit = res_counter_read_u64(&memcg->res, RES_LOW_LIMIT);
> >> + if (!low_limit)
> >> + return 0;
> >> +
> >> + usage = res_counter_read_u64(&memcg->res, RES_USAGE);
> >> +
> >> + if (usage < low_limit)
> >> + return DEF_PRIORITY - 2;
> >> +
> >> + for (i = 0; i < DEF_PRIORITY - 2; i++)
> >> + if (usage - low_limit > (usage >> (i + 3)))
> >> + break;
> >
> > why this doesn't depend in the current reclaim priority?
>
> How do you want to use reclaim priority here?
But then you can get up to 2*DEF_PRIORITY-2 priority (in
get_scan_count) in the end and we are back to my original and more
fundamental objection that the low_limit depends on the group size
because small groups basically do not get scanned when under/close_to
limit while big groups do get scanned and reclaimed.
> I don't like an idea to start ignoring low limit on some priorities.
Well, but you are doing that already. If you are reclaiming for prio 0 then
you add up just DEF_PRIORITY-2 which means you reclaim for all groups with
more than 1024 pages on the LRUs.
[...]
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2013-02-28 14:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 8:02 [PATCH] memcg: implement low limits Roman Gushchin
2013-02-27 8:20 ` Greg Thelen
[not found] ` <xr93y5eacgmj.fsf-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
2013-02-27 10:11 ` Roman Gushchin
[not found] ` <8121361952156-UZ+4eo27dRL0t1ZyImeKKJZIWCK8hONu@public.gmane.org>
2013-02-27 9:40 ` Michal Hocko
[not found] ` <20130227094054.GC16719-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-02-27 10:39 ` Roman Gushchin
[not found] ` <17521361961576-UZ+4eo27dRL0t1ZyImeKKJZIWCK8hONu@public.gmane.org>
2013-02-27 16:13 ` Michal Hocko
[not found] ` <20130227161352.GF16719-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-02-28 11:13 ` Roman Gushchin
2013-02-28 13:02 ` Michal Hocko
2013-02-27 14:57 ` Roman Gushchin
[not found] ` <38951361977052-uV6RMHoE7x/0t1ZyImeKKJZIWCK8hONu@public.gmane.org>
2013-02-28 14:30 ` Michal Hocko [this message]
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=20130228143052.GE6573@dhcp22.suse.cz \
--to=mhocko-alswssmvlrq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=klamm-XoJtRXgx1JseBXzfvpsJ4g@public.gmane.org \
--cc=kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mel-wPRd99KPJ+uzQB+pC5nmwQ@public.gmane.org \
--cc=riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.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