From: Andrew Morton <akpm@linux-foundation.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Mel Gorman <mel@csn.ul.ie>, Rik van Riel <riel@redhat.com>,
linux-mm <linux-mm@kvack.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mmotm-2010-01-06-14-34] check high watermark after shrink zone
Date: Tue, 12 Jan 2010 15:01:52 -0800 [thread overview]
Message-ID: <20100112150152.78604b78.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100108141235.ef56b567.minchan.kim@barrios-desktop>
On Fri, 8 Jan 2010 14:12:35 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:
> Kswapd check that zone have enough free by zone_water_mark.
> If any zone doesn't have enough page, it set all_zones_ok to zero.
> all_zone_ok makes kswapd retry not sleeping.
>
> I think the watermark check before shrink zone is pointless.
> Kswapd try to shrink zone then the check is meaningul.
>
> This patch move the check after shrink zone.
The changelog is rather hard to understand. I changed it to
: Kswapd checks that zone has sufficient pages free via zone_watermark_ok().
:
: If any zone doesn't have enough pages, we set all_zones_ok to zero.
: !all_zone_ok makes kswapd retry rather than sleeping.
:
: I think the watermark check before shrink_zone() is pointless. Only after
: kswapd has tried to shrink the zone is the check meaningful.
:
: Move the check to after the call to shrink_zone().
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Mel Gorman <mel@csn.ul.ie>
> CC: Rik van Riel <riel@redhat.com>
> ---
> mm/vmscan.c | 21 +++++++++++----------
> 1 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 885207a..b81adf8 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2057,9 +2057,6 @@ loop_again:
> priority != DEF_PRIORITY)
> continue;
>
> - if (!zone_watermark_ok(zone, order,
> - high_wmark_pages(zone), end_zone, 0))
> - all_zones_ok = 0;
This will make kswapd stop doing reclaim if all zones have
zone_is_all_unreclaimable():
if (zone_is_all_unreclaimable(zone))
continue;
This seems bad.
> temp_priority[i] = priority;
> sc.nr_scanned = 0;
> note_zone_scanning_priority(zone, priority);
> @@ -2099,13 +2096,17 @@ loop_again:
> total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2)
> sc.may_writepage = 1;
>
> - /*
> - * We are still under min water mark. it mean we have
> - * GFP_ATOMIC allocation failure risk. Hurry up!
> - */
> - if (!zone_watermark_ok(zone, order, min_wmark_pages(zone),
> - end_zone, 0))
> - has_under_min_watermark_zone = 1;
> + if (!zone_watermark_ok(zone, order,
> + high_wmark_pages(zone), end_zone, 0)) {
> + all_zones_ok = 0;
> + /*
> + * We are still under min water mark. it mean we have
> + * GFP_ATOMIC allocation failure risk. Hurry up!
> + */
> + if (!zone_watermark_ok(zone, order, min_wmark_pages(zone),
> + end_zone, 0))
> + has_under_min_watermark_zone = 1;
> + }
>
The vmscan.c code makes an effort to look nice in an 80-col display.
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-01-12 23:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-08 5:12 [PATCH -mmotm-2010-01-06-14-34] check high watermark after shrink zone Minchan Kim
2010-01-08 5:30 ` KOSAKI Motohiro
2010-01-10 14:25 ` Wu Fengguang
2010-01-12 23:01 ` Andrew Morton [this message]
2010-01-12 23:40 ` KOSAKI Motohiro
2010-01-13 1:51 ` Minchan Kim
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=20100112150152.78604b78.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).