From: Wu Fengguang <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: Andrea Arcangeli <andrea@suse.de>,
marcelo.tosatti@cyclades.com, linux-kernel@vger.kernel.org,
christoph@lameter.com, riel@redhat.com, a.p.zijlstra@chello.nl,
npiggin@suse.de, magnus.damm@gmail.com
Subject: Re: [PATCH 02/12] mm: supporting variables and functions for balanced zone aging
Date: Fri, 2 Dec 2005 14:38:39 +0800 [thread overview]
Message-ID: <20051202063839.GA3606@mail.ustc.edu.cn> (raw)
In-Reply-To: <20051201204549.68d3efac.akpm@osdl.org>
On Thu, Dec 01, 2005 at 08:45:49PM -0800, Andrew Morton wrote:
> Andrea Arcangeli <andrea@suse.de> wrote:
> >
> > low_mem_reserve
>
> I've a suspicion that the addition of the dma32 zone might have
> broken this.
And there is a danger of (the last zone != the largest zone). This breaks my
assumption. Either we should remove the two lines in shrink_zone():
> 865 if (sc->nr_to_reclaim <= 0)
> 866 break;
Or explicitly add more weight to the balancing efforts with
mm-add-weight-to-reclaim-for-aging.patch below.
Thanks,
Wu
Subject: mm: add more weight to reclaim for aging
Cc: Marcelo Tosatti <marcelo.tosatti@cyclades.com>, Magnus Damm <magnus.damm@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>, Andrea Arcangeli <andrea@suse.de>
Let HighMem = the last zone, we get in normal cases:
- HighMem zone is the largest zone
- HighMem zone is mainly reclaimed for watermark, other zones is almost always
reclaimed for aging
- While HighMem is reclaimed N times for watermark, other zones has N+1 chances
to reclaim for aging
- shrink_zone() only scans one chunk of SWAP_CLUSTER_MAX pages to get
SWAP_CLUSTER_MAX free pages
In the above situation, the force of balancing will win out the force of
unbalancing. But if HighMem(or the last zone) is not the largest zone, the
other larger zones can no longer catch up.
This patch multiplies the force of balancing by 8 times, which should be more
than enough. It just prevents shrink_zone() to return prematurely, and will
not cause DMA zone to be scanned more than SWAP_CLUSTER_MAX at one time in
normal cases.
Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
--- linux.orig/mm/vmscan.c
+++ linux/mm/vmscan.c
@@ -1453,12 +1453,14 @@ loop_again:
SC_RECLAIM_FROM_KSWAPD|
SC_RECLAIM_FOR_WATERMARK);
all_zones_ok = 0;
+ sc.nr_to_reclaim = SWAP_CLUSTER_MAX;
} else if (zone == youngest_zone &&
pages_more_aged(oldest_zone,
youngest_zone)) {
debug_reclaim(&sc,
SC_RECLAIM_FROM_KSWAPD|
SC_RECLAIM_FOR_AGING);
+ sc.nr_to_reclaim = SWAP_CLUSTER_MAX * 8;
} else
continue;
}
next prev parent reply other threads:[~2005-12-02 6:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-01 10:18 [PATCH 00/12] Balancing the scan rate of major caches Wu Fengguang
2005-12-01 10:18 ` [PATCH 01/12] vm: kswapd incmin Wu Fengguang
2005-12-01 10:33 ` Andrew Morton
2005-12-01 11:40 ` Wu Fengguang
2005-12-01 10:18 ` [PATCH 02/12] mm: supporting variables and functions for balanced zone aging Wu Fengguang
2005-12-01 10:37 ` Andrew Morton
2005-12-01 12:11 ` Wu Fengguang
2005-12-01 22:28 ` Marcelo Tosatti
2005-12-01 23:03 ` Andrew Morton
2005-12-02 1:19 ` Wu Fengguang
2005-12-02 1:30 ` Andrew Morton
2005-12-02 2:04 ` Wu Fengguang
2005-12-02 2:18 ` Andrea Arcangeli
2005-12-02 2:37 ` Wu Fengguang
2005-12-02 2:52 ` Andrea Arcangeli
2005-12-02 4:45 ` Andrew Morton
2005-12-02 6:38 ` Wu Fengguang [this message]
2005-12-02 2:27 ` Nick Piggin
2005-12-02 2:36 ` Andrea Arcangeli
2005-12-02 2:43 ` Wu Fengguang
2005-12-02 5:49 ` Andrew Morton
2005-12-02 7:18 ` Wu Fengguang
2005-12-02 7:27 ` Andrew Morton
2005-12-02 15:13 ` Marcelo Tosatti
2005-12-02 21:39 ` Andrew Morton
2005-12-03 0:26 ` Marcelo Tosatti
2005-12-04 6:06 ` Wu Fengguang
2005-12-02 1:26 ` Marcelo Tosatti
2005-12-02 3:40 ` Andrew Morton
2005-12-01 10:18 ` [PATCH 03/12] mm: balance zone aging in direct reclaim path Wu Fengguang
2005-12-01 10:18 ` [PATCH 04/12] mm: balance zone aging in kswapd " Wu Fengguang
2005-12-01 10:18 ` [PATCH 05/12] mm: balance slab aging Wu Fengguang
2005-12-01 10:18 ` [PATCH 06/12] mm: balance active/inactive list scan rates Wu Fengguang
2005-12-01 11:39 ` Peter Zijlstra
2005-12-01 10:18 ` [PATCH 07/12] mm: remove unnecessary variable and loop Wu Fengguang
2005-12-01 10:18 ` [PATCH 08/12] mm: remove swap_cluster_max from scan_control Wu Fengguang
2005-12-01 10:18 ` [PATCH 09/12] mm: accumulate sc.nr_scanned/sc.nr_reclaimed Wu Fengguang
2005-12-01 10:18 ` [PATCH 10/12] mm: merge sc.may_writepage and sc.may_swap into sc.flags Wu Fengguang
2005-12-01 10:18 ` [PATCH 11/12] mm: add page reclaim debug traces Wu Fengguang
2005-12-01 10:18 ` [PATCH 12/12] mm: fix minor scan count bugs Wu Fengguang
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=20051202063839.GA3606@mail.ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=christoph@lameter.com \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=marcelo.tosatti@cyclades.com \
--cc=npiggin@suse.de \
--cc=riel@redhat.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
all inboxes | Powered by JetHome®