[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090501012212.GA5848@localhost>
Date: Fri, 1 May 2009 09:22:12 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Cc: "torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"kosaki.motohiro@...fujitsu.com" <kosaki.motohiro@...fujitsu.com>,
"lee.schermerhorn@...com" <lee.schermerhorn@...com>,
"peterz@...radead.org" <peterz@...radead.org>,
"riel@...hat.com" <riel@...hat.com>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [patch 20/22] vmscan: avoid multiplication overflow in
shrink_zone()
On Fri, May 01, 2009 at 06:08:55AM +0800, Andrew Morton wrote:
>
> Local variable `scan' can overflow on zones which are larger than
>
> (2G * 4k) / 100 = 80GB.
>
> Making it 64-bit on 64-bit will fix that up.
A side note about the "one HUGE scan inside shrink_zone":
Isn't this low level scan granularity way tooooo large?
It makes things a lot worse on memory pressure:
- the over reclaim, somehow workarounded by Rik's early bail out patch
- the throttle_vm_writeout()/congestion_wait() guards could work in a
very sparse manner and hence is useless: imagine to stop and wait
after shooting away every 1GB memory.
The long term fix could be to move the granularity control up to the
shrink_zones() level: there it can bail out early without hurting the
balanced zone aging.
Thanks,
Fengguang
> --- a/mm/vmscan.c~vmscan-avoid-multiplication-overflow-in-shrink_zone
> +++ a/mm/vmscan.c
> @@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, st
>
> for_each_evictable_lru(l) {
> int file = is_file_lru(l);
> - int scan;
> + unsigned long scan;
>
> scan = zone_nr_pages(zone, sc, l);
> if (priority) {
> _
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists