Re: System freezes after OOM

From: Mikulas Patocka
Date: Fri Jul 15 2016 - 19:53:56 EST




On Fri, 15 Jul 2016, David Rientjes wrote:

> Kworkers are processing writeback, ext4_writepages() relies on kmem that

ext4_writepages is above device mapper, not below, so how it could block
device mapper progress?

Do you use device mapper on the top of block loop device? Writing to loop
is prone to deadlock anyway, you should avoid that in production code.

> is reclaiming memory itself through kmem_getpages() and they are waiting
> on the oom victim to exit so they endlessly loop in the page allocator
> themselves. Same situation with __alloc_skb() so we can intermittently
> lose access to hundreds of the machines over the network. There are no
> custom drivers required for this to happen, the stack trace has already
> been posted of the livelock victim and this can happen for anything in
> filemap_fault() that has TIF_MEMDIE set.

Again - filemap_failt() is above device mapper, not below (unless you use
loop).

> > > frankly don't care about your patch reviewing of dm mempool usage when
> > > dm_request() livelocked our kernel.
> >
> > If it livelocked, it is a bug in some underlying block driver, not a bug
> > in mempool_alloc.
> >
>
> Lol, the interface is quite clear and can be modified to allow mempool
> users to set __GFP_NOMEMALLOC on their mempool_alloc() request if they can
> guarantee elements will be returned to the freelist in all situations,

You still didn't post configuration of your block stack, so I have no clue
why entries are not returned to the mempool.

> including system oom situations. We may revert that ourselves if our
> machines time out once we use a post-4.7 kernel and report that as
> necessary.

Mikulas