From: Minchan Kim <minchan.kim@gmail.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux-mm <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch]vmscan: make kswapd use a correct order
Date: Wed, 1 Dec 2010 13:21:07 +0900 [thread overview]
Message-ID: <AANLkTi=whw86_7T0tVi5S8xmwS+Z3PDE_AbXEJSQFqR4@mail.gmail.com> (raw)
In-Reply-To: <1291172911.12777.58.camel@sli10-conroe>
On Wed, Dec 1, 2010 at 12:08 PM, Shaohua Li <shaohua.li@intel.com> wrote:
> T0: Task1 wakeup_kswapd(order=3)
> T1: kswapd enters balance_pgdat
> T2: Task2 wakeup_kswapd(order=2), because pages reclaimed by kswapd are used
> quickly
> T3: kswapd exits balance_pgdat. kswapd will do check. Now new order=2,
> pgdat->kswapd_max_order will become 0, but order=3, if sleeping_prematurely,
> then order will become pgdat->kswapd_max_order(0), while at this time the
> order should 2
> This isn't a big deal, but we do have a small window the order is wrong.
>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Reviewed-by: Minchan Kim <minchan.kim@gmai.com>
But you need the description more easily.
I try it.
T0 : Task 1 wakes up kswapd with order-3
T1 : So, kswapd starts to reclaim pages using balance_pgdat
T2: Task 2 wakes up kswapd with order-2 because pages reclaimed by T1
are consumed quickly.
T3: kswapd exits balance_pgdat and will recheck remained work
T4-1 : In beginning of kswapd's loop, pgdat->kswapd_max_order will be
reset with zero.
T4-2: If previous balance_pgdat can't meet requirement of order-3 free
pages by high watermark, it can start reclaiming again.
T4-3 :Unfortunately, balance_pgdat's argument _order_ is
pgdat->kswapd_max_order which was zero. It should have been 2.
Regardless of my suggestion, I will add my Reviewed-by.
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index d31d7ce..15cd0d2 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2450,7 +2450,7 @@ static int kswapd(void *p)
> }
> }
>
> - order = pgdat->kswapd_max_order;
> + order = max_t(unsigned long, new_order, pgdat->kswapd_max_order);
> }
> finish_wait(&pgdat->kswapd_wait, &wait);
>
>
>
> --
> 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 policy in Canada: sign http://dissolvethecrtc.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-12-01 4:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 3:08 Shaohua Li
2010-12-01 4:21 ` Minchan Kim [this message]
2010-12-01 5:42 ` Shaohua Li
2010-12-01 9:44 ` KOSAKI Motohiro
2010-12-01 15:58 ` Minchan Kim
2010-12-02 0:09 ` KOSAKI Motohiro
2010-12-02 0:29 ` KOSAKI Motohiro
2010-12-02 0:58 ` Minchan Kim
2010-12-02 0:19 ` Andrew Morton
2010-12-02 9:40 ` Mel Gorman
2010-12-02 0:29 ` Shaohua Li
2010-12-02 0:54 ` Minchan Kim
2010-12-02 1:05 ` Shaohua Li
2010-12-02 1:23 ` Minchan Kim
2010-12-02 1:36 ` Minchan Kim
2010-12-02 9:42 ` Mel Gorman
2010-12-02 15:25 ` Minchan Kim
2010-12-02 2:39 ` Shaohua Li
2010-12-02 1:28 ` KOSAKI Motohiro
2010-12-02 10:12 ` Mel Gorman
2010-12-02 15:35 ` Minchan Kim
2010-12-02 15:42 ` Mel Gorman
2010-12-02 20:53 ` Simon Kirby
2010-12-03 12:00 ` Mel Gorman
2010-12-04 12:07 ` Simon Kirby
2010-12-06 12:03 ` Mel Gorman
2010-12-09 23:44 ` Simon Kirby
2010-12-10 11:32 ` Mel Gorman
2010-12-10 23:42 ` Simon Kirby
2010-12-14 9:52 ` Mel Gorman
2010-12-02 16:00 [PATCH] vmscan: " Minchan Kim
2010-12-03 12:11 ` Mel Gorman
2010-12-09 22:13 ` Andrew Morton
2010-12-10 3:53 ` Minchan Kim
2010-12-10 11:17 ` Mel Gorman
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='AANLkTi=whw86_7T0tVi5S8xmwS+Z3PDE_AbXEJSQFqR4@mail.gmail.com' \
--to=minchan.kim@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=shaohua.li@intel.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