From: Minchan Kim <minchan.kim@gmail.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>,
"mgorman@suse.de" <mgorman@suse.de>,
Ying Han <yinghan@google.com>
Subject: Re: [PATCH v2] fix get_scan_count for working well with small targets
Date: Wed, 27 Apr 2011 14:08:18 +0900 [thread overview]
Message-ID: <BANLkTi=zDFrgqn-Mpo2R1M0F_+aMo-byZg@mail.gmail.com> (raw)
In-Reply-To: <20110427105031.db203b95.kamezawa.hiroyu@jp.fujitsu.com>
Hi Kame,
On Wed, Apr 27, 2011 at 10:50 AM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Tue, 26 Apr 2011 13:59:34 -0700
> Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> What about simply removing the nr_saved_scan logic and permitting small
>> scans? That simplifies the code and I bet it makes no measurable
>> performance difference.
>>
>
> ok, v2 here. How this looks ?
> For memcg, I think I should add select_victim_node() for direct reclaim,
> then, we'll be tune big memcg using small memory on a zone case.
>
> ==
> 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.)
Nice catch! It looks to be much enhance.
> But if the amount of pages is smaller than 16M, no scan at priority==0
> forever.
Before reviewing the code, I have a question about this.
Now, in case of (priority = 0), we don't do shift operation with priority.
So nr_saved_scan would be the number of lru list pages. ie, 16M.
Why no-scan happens in case of (priority == 0 and 16M lru pages)?
What am I missing now?
>
> 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.
It makes sense.
--
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>
next prev parent reply other threads:[~2011-04-27 5:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 9:17 [PATCH] fix get_scan_count for working well with small targets KAMEZAWA Hiroyuki
2011-04-26 17:36 ` Ying Han
2011-04-26 23:58 ` KAMEZAWA Hiroyuki
2011-04-26 20:59 ` Andrew Morton
2011-04-26 23:46 ` KAMEZAWA Hiroyuki
2011-04-27 1:50 ` [PATCH v2] " KAMEZAWA Hiroyuki
2011-04-27 3:09 ` KAMEZAWA Hiroyuki
2011-04-27 5:08 ` Minchan Kim [this message]
2011-04-27 5:31 ` KAMEZAWA Hiroyuki
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=zDFrgqn-Mpo2R1M0F_+aMo-byZg@mail.gmail.com' \
--to=minchan.kim@gmail.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=nishimura@mxp.nes.nec.co.jp \
--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).