All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lutomirski <luto@mit.edu>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kernel falls apart under light memory pressure (i.e. linking vmlinux)
Date: Wed, 11 May 2011 19:28:46 -0400	[thread overview]
Message-ID: <BANLkTikhj1C7+HXP_4T-VnJzPefU2d7b3A@mail.gmail.com> (raw)
In-Reply-To: <m2fwokj0oz.fsf@firstfloor.org>

On Wed, May 11, 2011 at 7:07 PM, Andi Kleen <andi@firstfloor.org> wrote:
> Andrew Lutomirski <luto@mit.edu> writes:
>>
>> I can sometimes (but not always) trigger this by enabling swap and
>> running dirty_ram 2048 (attached).  (One time it took the system down
>> completely.  I have ~8 GB of swap, all of which was empty when I ran
>
> Never configure that much swap (> 1*RAM). It will just make any OOM more
> painful because it'll thrash forever. If you're 4x overcommited
> no workload will be happy.

Agreed.  But I only need to overcommit by a little to get it to crash.

>
>> This box is a Lenovo X220 Sandy Bridge laptop with 2G of RAM (the old
>> box had more) and runs ext4 on LVM on dm-crypt on an SSD.  I see the
>
> FWIW i had problems in swapping over dmcrypt for a long time -- not
> quite as severe as you. Never really tracked it down.
>
> But I suspect just not doing the swap over dmcrypt would make
> it a lot more usable.

Maybe.  But I can get to it crash just fine without any swap at all,
which I think ought to be the most stable configuration.

>
>> If I had to guess, I'd say that the VM gets confused when it's forced
>> to write data out to my LVM-over-dm-crypt partition and either starts
>> OOM-killing things when it's not out of memory or deadlocks because it
>> runs out of available RAM and can't service new dm-crypt and block
>> requests.
>>
>> Please help fix/debug this.  It's making my shiny new laptop almost useless.
>
> I would add some tracing to the dmcrypt paths and then log
> it over the network during the problem. Most likely some part
> of it stalls or tries to allocate more memory.

Yep, that's next.  I just added some instrumentation in mempool_alloc
to warn if it can't satisfy an allocation for five seconds and it
didn't trigger.  Most of the dm-crypt allocations I could find go
through mempool, so I think they're ruled out.

Do softlockups in kswapd0 mean anything?  I think I can rule out a
traditional vm deadlock, because the machine is currently stuck with
tons of things hitting the softlockup warning but with 809M of DMA32
space free (as well as 8M DMA and 16kB normal).

Here's a nice picture of alt-sysrq-m with lots of memory free but the
system mostly hung.  I can still switch VTs.

http://web.mit.edu/luto/www/meminfo.jpg

alt-sysrq-j to thaw filesystems caused the system to start printing
"Emergency Thaw on dm-2" in an infinite loop.  Time to power off and
go home...

--Andy

>
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only
>

  reply	other threads:[~2011-05-11 23:29 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 [this message]
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
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=BANLkTikhj1C7+HXP_4T-VnJzPefU2d7b3A@mail.gmail.com \
    --to=luto@mit.edu \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.