From: Ying Han <yinghan@google.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"mgorman@suse.de" <mgorman@suse.de>
Subject: Re: [PATCHv3] memcg: fix get_scan_count for small targets
Date: Wed, 27 Apr 2011 10:56:11 -0700 [thread overview]
Message-ID: <BANLkTi=zoFK2HVC64qqeHVO_kq4KOBLOrA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTim-U3MTnToFPL11NcVnOCig4zJMAQ@mail.gmail.com>
Acked-by: Ying Han <yinghan@google.com>
--Ying
On Wed, Apr 27, 2011 at 2:14 AM, Minchan Kim <minchan.kim@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 5:48 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>> On Wed, 27 Apr 2011 17:48:18 +0900
>> Minchan Kim <minchan.kim@gmail.com> wrote:
>>
>>> On Wed, Apr 27, 2011 at 4:47 PM, KAMEZAWA Hiroyuki
>>> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>>> > At memory reclaim, we determine the number of pages to be scanned
>>> > per zone as
>>> > (anon + file) >> priority.
>>> > Assume
>>> > scan = (anon + file) >> priority.
>>> >
>>> > If scan < SWAP_CLUSTER_MAX, the scan will be skipped for this time
>>> > and priority gets higher. This has some problems.
>>> >
>>> > 1. This increases priority as 1 without any scan.
>>> > To do scan in this priority, amount of pages should be larger than 512M.
>>> > If pages>>priority < SWAP_CLUSTER_MAX, it's recorded and scan will be
>>> > batched, later. (But we lose 1 priority.)
>>> > If memory size is below 16M, pages >> priority is 0 and no scan in
>>> > DEF_PRIORITY forever.
>>> >
>>> > 2. If zone->all_unreclaimabe==true, it's scanned only when priority==0.
>>> > So, x86's ZONE_DMA will never be recoverred until the user of pages
>>> > frees memory by itself.
>>> >
>>> > 3. With memcg, the limit of memory can be small. When using small memcg,
>>> > it gets priority < DEF_PRIORITY-2 very easily and need to call
>>> > wait_iff_congested().
>>> > For doing scan before priorty=9, 64MB of memory should be used.
>>> >
>>> > Then, this patch tries to scan SWAP_CLUSTER_MAX of pages in force...when
>>> >
>>> > 1. the target is enough small.
>>> > 2. it's kswapd or memcg reclaim.
>>> >
>>> > Then we can avoid rapid priority drop and may be able to recover
>>> > all_unreclaimable in a small zones. And this patch removes nr_saved_scan.
>>> > This will allow scanning in this priority even when pages >> priority
>>> > is very small.
>>> >
>>> > Changelog v2->v3
>>> > - removed nr_saved_scan completely.
>>> >
>>> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>> Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
>>>
>>> The patch looks good to me but I have a nitpick about just coding style.
>>> How about this? I think below looks better but it's just my private
>>> opinion and I can't insist on my style. If you don't mind it, ignore.
>>>
>>
>> I did this at the 1st try and got bug.....a variable 'file' here is
>> reused and now broken. Renaming it with new variable will be ok, but it
>
> Right you are. I missed that. :)
> Thanks.
>
>
> --
> Kind regards,
> Minchan Kim
>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2011-04-27 17:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 7:47 [PATCHv3] memcg: fix get_scan_count for small targets KAMEZAWA Hiroyuki
2011-04-27 8:48 ` Minchan Kim
2011-04-27 8:48 ` KAMEZAWA Hiroyuki
2011-04-27 9:14 ` Minchan Kim
2011-04-27 17:56 ` Ying Han [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='BANLkTi=zoFK2HVC64qqeHVO_kq4KOBLOrA@mail.gmail.com' \
--to=yinghan@google.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
--cc=nishimura@mxp.nes.nec.co.jp \
/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).