Re: Kernel falls apart under light memory pressure (i.e. linking vmlinux)

From: Andi Kleen
Date: Wed May 11 2011 - 19:08:08 EST


Andrew Lutomirski <luto@xxxxxxx> 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.

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

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

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/