All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan.kim@gmail.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andrew Lutomirski <luto@mit.edu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Kernel falls apart under light memory pressure (i.e. linking vmlinux)
Date: Mon, 16 May 2011 07:40:42 +0900	[thread overview]
Message-ID: <BANLkTinv=_38E3Eyu88Ra4-x5vPEq7CDkw@mail.gmail.com> (raw)
In-Reply-To: <20110515152747.GA25905@localhost>

On Mon, May 16, 2011 at 12:27 AM, Wu Fengguang <fengguang.wu@intel.com> wrote:
> On Sun, May 15, 2011 at 09:37:58AM +0800, Minchan Kim wrote:
>> On Sun, May 15, 2011 at 2:43 AM, Andi Kleen <andi@firstfloor.org> wrote:
>> > Copying back linux-mm.
>> >
>> >> Recently, we added following patch.
>> >> https://lkml.org/lkml/2011/4/26/129
>> >> If it's a culprit, the patch should solve the problem.
>> >
>> > It would be probably better to not do the allocations at all under
>> > memory pressure.  Even if the RA allocation doesn't go into reclaim
>>
>> Fair enough.
>> I think we can do it easily now.
>> If page_cache_alloc_readahead(ie, GFP_NORETRY) is fail, we can adjust
>> RA window size or turn off a while. The point is that we can use the
>> fail of __do_page_cache_readahead as sign of memory pressure.
>> Wu, What do you think?
>
> No, disabling readahead can hardly help.

I don't mean we have to disable RA.
As I said, the point is that we can use __GFP_NORETRY alloc fail as
_sign_ of memory pressure.

>
> The sequential readahead memory consumption can be estimated by
>
>                2 * (number of concurrent read streams) * (readahead window size)
>
> And you can double that when there are two level of readaheads.
>
> Since there are hardly any concurrent read streams in Andy's case,
> the readahead memory consumption will be ignorable.
>
> Typically readahead thrashing will happen long before excessive
> GFP_NORETRY failures, so the reasonable solutions are to

If it is, RA thrashing could be better sign than failure of __GFP_NORETRY.
If we can do it easily, I don't object it. :)

>
> - shrink readahead window on readahead thrashing
>  (current readahead heuristic can somehow do this, and I have patches
>  to further improve it)

Good to hear. :)
I don't want RA steals high order page in memory pressure.
My patch and shrinking RA window helps this case.

-- 
Kind regards,
Minchan Kim

WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan.kim@gmail.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andrew Lutomirski <luto@mit.edu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Kernel falls apart under light memory pressure (i.e. linking vmlinux)
Date: Mon, 16 May 2011 07:40:42 +0900	[thread overview]
Message-ID: <BANLkTinv=_38E3Eyu88Ra4-x5vPEq7CDkw@mail.gmail.com> (raw)
In-Reply-To: <20110515152747.GA25905@localhost>

On Mon, May 16, 2011 at 12:27 AM, Wu Fengguang <fengguang.wu@intel.com> wrote:
> On Sun, May 15, 2011 at 09:37:58AM +0800, Minchan Kim wrote:
>> On Sun, May 15, 2011 at 2:43 AM, Andi Kleen <andi@firstfloor.org> wrote:
>> > Copying back linux-mm.
>> >
>> >> Recently, we added following patch.
>> >> https://lkml.org/lkml/2011/4/26/129
>> >> If it's a culprit, the patch should solve the problem.
>> >
>> > It would be probably better to not do the allocations at all under
>> > memory pressure.  Even if the RA allocation doesn't go into reclaim
>>
>> Fair enough.
>> I think we can do it easily now.
>> If page_cache_alloc_readahead(ie, GFP_NORETRY) is fail, we can adjust
>> RA window size or turn off a while. The point is that we can use the
>> fail of __do_page_cache_readahead as sign of memory pressure.
>> Wu, What do you think?
>
> No, disabling readahead can hardly help.

I don't mean we have to disable RA.
As I said, the point is that we can use __GFP_NORETRY alloc fail as
_sign_ of memory pressure.

>
> The sequential readahead memory consumption can be estimated by
>
>                2 * (number of concurrent read streams) * (readahead window size)
>
> And you can double that when there are two level of readaheads.
>
> Since there are hardly any concurrent read streams in Andy's case,
> the readahead memory consumption will be ignorable.
>
> Typically readahead thrashing will happen long before excessive
> GFP_NORETRY failures, so the reasonable solutions are to

If it is, RA thrashing could be better sign than failure of __GFP_NORETRY.
If we can do it easily, I don't object it. :)

>
> - shrink readahead window on readahead thrashing
>  (current readahead heuristic can somehow do this, and I have patches
>  to further improve it)

Good to hear. :)
I don't want RA steals high order page in memory pressure.
My patch and shrinking RA window helps this case.

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

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

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 22:42 Kernel falls apart under light memory pressure (i.e. linking vmlinux) Andrew Lutomirski
2011-05-11 23:07 ` Andi Kleen
2011-05-11 23:28   ` Andrew Lutomirski
2011-05-12  5:46     ` Andi Kleen
2011-05-12 11:54       ` Andrew Lutomirski
2011-05-14 15:46         ` Andrew Lutomirski
2011-05-14 15:46           ` Andrew Lutomirski
2011-05-14 16:53           ` Andi Kleen
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:27                     ` Wu Fengguang
2011-05-15 15:59                     ` Andrew Lutomirski
2011-05-15 15:59                       ` Andrew Lutomirski
2011-05-15 22:58                       ` Minchan Kim
2011-05-15 22:58                         ` Minchan Kim
2011-05-16  8:51                         ` Mel Gorman
2011-05-16  8:51                           ` Mel Gorman
2011-05-15 16:12                     ` Andrew Lutomirski
2011-05-15 16:12                       ` Andrew Lutomirski
2011-05-17  6:00                       ` Wu Fengguang
2011-05-17  6:00                         ` Wu Fengguang
2011-05-17  6:35                         ` Minchan Kim
2011-05-17  6:35                           ` Minchan Kim
2011-05-17 19:22                         ` Andrew Lutomirski
2011-05-18  5:17                           ` Minchan Kim
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:30                                 ` KAMEZAWA Hiroyuki
2011-05-19  2:41                                 ` Andrew Lutomirski
2011-05-19  2:54                               ` Minchan Kim
2011-05-19  2:54                                 ` Minchan Kim
2011-05-19 14:16                                 ` Andrew Lutomirski
2011-05-20  0:17                                   ` Minchan Kim
2011-05-20  0:17                                     ` Minchan Kim
2011-05-20  2:58                                   ` Andrew Lutomirski
2011-05-20  2:58                                     ` Andrew Lutomirski
2011-05-20  3:12                                     ` KOSAKI Motohiro
2011-05-20  3:12                                       ` KOSAKI Motohiro
2011-05-20  3:38                                       ` Andrew Lutomirski
2011-05-20  3:38                                         ` Andrew Lutomirski
2011-05-20  4:20                                         ` Minchan Kim
2011-05-20  4:20                                           ` Minchan Kim
2011-05-20  5:08                                           ` KAMEZAWA Hiroyuki
2011-05-20  5:08                                             ` KAMEZAWA Hiroyuki
2011-05-20  5:36                                             ` Minchan Kim
2011-05-20  5:36                                               ` Minchan Kim
2011-05-20  7:43                                               ` KAMEZAWA Hiroyuki
2011-05-20  7:43                                                 ` KAMEZAWA Hiroyuki
2011-05-20 10:11                                             ` Andrea Arcangeli
2011-05-20 10:11                                               ` Andrea Arcangeli
2011-05-20 14:11                                               ` Andrew Lutomirski
2011-05-20 15:33                                                 ` Minchan Kim
2011-05-20 15:33                                                   ` Minchan Kim
2011-05-20 16:01                                                   ` Andrew Lutomirski
2011-05-20 16:01                                                     ` Andrew Lutomirski
2011-05-20 16:19                                                     ` Minchan Kim
2011-05-20 16:19                                                       ` Minchan Kim
2011-05-20 18:09                                                       ` Andrew Lutomirski
2011-05-20 18:40                                                         ` Andrew Lutomirski
2011-05-20 18:40                                                           ` Andrew Lutomirski
2011-05-21 12:04                                                         ` KOSAKI Motohiro
2011-05-21 12:04                                                           ` KOSAKI Motohiro
2011-05-21 13:34                                                           ` Andrew Lutomirski
2011-05-21 13:34                                                             ` Andrew Lutomirski
2011-05-21 14:14                                                             ` KOSAKI Motohiro
2011-05-21 14:14                                                               ` KOSAKI Motohiro
2011-05-21 14:44                                                             ` Minchan Kim
2011-05-21 14:44                                                               ` Minchan Kim
2011-05-22 12:22                                                               ` Andrew Lutomirski
2011-05-22 12:22                                                                 ` Andrew Lutomirski
2011-05-22 23:12                                                                 ` Minchan Kim
2011-05-22 23:12                                                                   ` Minchan Kim
2011-05-23 16:42                                                                   ` Andrea Arcangeli
2011-05-23 16:42                                                                     ` Andrea Arcangeli
2011-05-23 17:35                                                                     ` Mel Gorman
2011-05-23 17:35                                                                       ` Mel Gorman
2011-05-24  1:19                                                                   ` Andrew Lutomirski
2011-05-24  1:34                                                                     ` Minchan Kim
2011-05-24  1:34                                                                       ` Minchan Kim
2011-05-24 11:24                                                                       ` Andrew Lutomirski
2011-05-24 11:24                                                                         ` Andrew Lutomirski
2011-05-24 11:55                                                                         ` Andrew Lutomirski
2011-05-25  0:43                                                                           ` KOSAKI Motohiro
2011-05-25  0:43                                                                             ` KOSAKI Motohiro
2011-05-21 14:31                                                           ` Minchan Kim
2011-05-21 14:31                                                             ` Minchan Kim
2011-05-19 14:51                             ` Wu Fengguang
2011-05-19 14:51                               ` Wu Fengguang
2011-05-19 15:00                               ` Andrew Lutomirski
2011-05-19 15:00                                 ` Andrew Lutomirski
2011-05-20  0:20                               ` Minchan Kim
2011-05-20  0:20                                 ` Minchan Kim
2011-05-15 22:40                     ` Minchan Kim [this message]
2011-05-15 22:40                       ` Minchan Kim
2011-05-17  5:52                       ` Wu Fengguang
2011-05-17  5:52                         ` Wu Fengguang
2011-05-17  6:26                         ` Minchan Kim
2011-05-17  6:26                           ` Minchan Kim
2011-05-20 10:40   ` Andrea Arcangeli

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='BANLkTinv=_38E3Eyu88Ra4-x5vPEq7CDkw@mail.gmail.com' \
    --to=minchan.kim@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.