linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan.kim@gmail.com>
To: Andrew Lutomirski <luto@mit.edu>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
	Andi Kleen <andi@firstfloor.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Mel Gorman <mel@csn.ul.ie>, Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: Kernel falls apart under light memory pressure (i.e. linking vmlinux)
Date: Mon, 16 May 2011 07:58:01 +0900	[thread overview]
Message-ID: <BANLkTinEC1uhZRXjjn1PzENNs7KtGcoQow@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinYGwRa_7uGzbYq+pW3T7jL-nQ7sA@mail.gmail.com>

On Mon, May 16, 2011 at 12:59 AM, Andrew Lutomirski <luto@mit.edu> wrote:
> I have no clue, but this patch (from Minchan, whitespace-damaged) seems to help:
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index f6b435c..4d24828 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2251,6 +2251,10 @@ static bool sleeping_prematurely(pg_data_t
> *pgdat, int order, long remaining,
>       unsigned long balanced = 0;
>       bool all_zones_ok = true;
>
> +       /* If kswapd has been running too long, just sleep */
> +       if (need_resched())
> +               return false;
> +
>       /* If a direct reclaimer woke kswapd within HZ/10, it's premature */
>       if (remaining)
>               return true;
> @@ -2286,7 +2290,7 @@ static bool sleeping_prematurely(pg_data_t
> *pgdat, int order, long remaining,
>        * must be balanced
>        */
>       if (order)
> -               return pgdat_balanced(pgdat, balanced, classzone_idx);
> +               return !pgdat_balanced(pgdat, balanced, classzone_idx);
>       else
>               return !all_zones_ok;
>  }
>
> I haven't tested it very thoroughly, but it's survived much longer
> than an unpatched kernel probably would have under moderate use.
>
> I have no idea what the patch does :)

The reason I sent this is that I think your problem is similar to
recent Jame's one.
https://lkml.org/lkml/2011/4/27/361

What the patch does is [1] fix of "wrong pgdat_balanced return value"
bug and [2] fix of "infinite kswapd bug of non-preemption kernel" on
high-order page.

About [1], kswapd have to sleep if zone balancing is completed but in
1741c877[mm: kswapd: keep kswapd awake for high-order allocations
until a percentage of the node is balanced], we made a mistake that
returns wrong return.
Then, although we complete zone balancing, kswapd doesn't sleep and
calls balance_pgdat. In this case, balance_pgdat rerurns without any
work and kswapd could repeat this work infinitely.


>
> I'm happy to run any tests.  I'm also planning to upgrade from 2GB to
> 8GB RAM soon, which might change something.
>
> --Andy
>



-- 
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>

  reply	other threads:[~2011-05-15 22:58 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTi=XqROAp2MOgwQXEQjdkLMenh_OTQ@mail.gmail.com>
     [not found] ` <m2fwokj0oz.fsf@firstfloor.org>
     [not found]   ` <BANLkTikhj1C7+HXP_4T-VnJzPefU2d7b3A@mail.gmail.com>
     [not found]     ` <20110512054631.GI6008@one.firstfloor.org>
     [not found]       ` <BANLkTi=fk3DUT9cYd2gAzC98c69F6HXX7g@mail.gmail.com>
2011-05-14 15:46         ` Kernel falls apart under light memory pressure (i.e. linking vmlinux) Andrew Lutomirski
2011-05-14 16:53           ` Andi Kleen
     [not found]             ` <BANLkTik6SS9NH7XVSRBoCR16_5veY0MKBw@mail.gmail.com>
2011-05-14 17:43               ` Andi Kleen
2011-05-15  1:37                 ` Minchan Kim
2011-05-15 15:27                   ` Wu Fengguang
2011-05-15 15:59                     ` Andrew Lutomirski
2011-05-15 22:58                       ` Minchan Kim [this message]
2011-05-16  8:51                         ` Mel Gorman
2011-05-15 16:12                     ` Andrew Lutomirski
2011-05-17  6:00                       ` Wu Fengguang
2011-05-17  6:35                         ` Minchan Kim
2011-05-17 19:22                         ` Andrew Lutomirski
2011-05-18  5:17                           ` Minchan Kim
2011-05-19  2:15                             ` Andrew Lutomirski
2011-05-19  2:30                               ` KAMEZAWA Hiroyuki
2011-05-19  2:41                                 ` Andrew Lutomirski
2011-05-19  2:54                               ` Minchan Kim
2011-05-19 14:16                                 ` Andrew Lutomirski
2011-05-20  0:17                                   ` Minchan Kim
2011-05-20  2:58                                   ` Andrew Lutomirski
2011-05-20  3:12                                     ` KOSAKI Motohiro
2011-05-20  3:38                                       ` Andrew Lutomirski
2011-05-20  4:20                                         ` Minchan Kim
2011-05-20  5:08                                           ` KAMEZAWA Hiroyuki
2011-05-20  5:36                                             ` Minchan Kim
2011-05-20  7:43                                               ` KAMEZAWA Hiroyuki
2011-05-20 10:11                                             ` Andrea Arcangeli
2011-05-20 14:11                                               ` Andrew Lutomirski
2011-05-20 15:33                                                 ` Minchan Kim
2011-05-20 16:01                                                   ` Andrew Lutomirski
2011-05-20 16:19                                                     ` Minchan Kim
2011-05-20 18:09                                                       ` Andrew Lutomirski
2011-05-20 18:40                                                         ` Andrew Lutomirski
2011-05-21 12:04                                                         ` KOSAKI Motohiro
2011-05-21 13:34                                                           ` Andrew Lutomirski
2011-05-21 14:14                                                             ` KOSAKI Motohiro
2011-05-21 14:44                                                             ` Minchan Kim
2011-05-22 12:22                                                               ` Andrew Lutomirski
2011-05-22 23:12                                                                 ` Minchan Kim
2011-05-23 16:42                                                                   ` Andrea Arcangeli
2011-05-23 17:35                                                                     ` Mel Gorman
2011-05-24  1:19                                                                   ` Andrew Lutomirski
2011-05-24  1:34                                                                     ` Minchan Kim
2011-05-24 11:24                                                                       ` Andrew Lutomirski
2011-05-24 11:55                                                                         ` Andrew Lutomirski
2011-05-25  0:43                                                                           ` KOSAKI Motohiro
2011-05-21 14:31                                                           ` Minchan Kim
2011-05-19 14:51                             ` Wu Fengguang
2011-05-19 15:00                               ` Andrew Lutomirski
2011-05-20  0:20                               ` Minchan Kim
2011-05-15 22:40                     ` Minchan Kim
2011-05-17  5:52                       ` Wu Fengguang
2011-05-17  6:26                         ` 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=BANLkTinEC1uhZRXjjn1PzENNs7KtGcoQow@mail.gmail.com \
    --to=minchan.kim@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=andi@firstfloor.org \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@mit.edu \
    --cc=mel@csn.ul.ie \
    /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).