• Michal Hocko's avatar
    mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress · 373ccbe5
    Michal Hocko authored
    Tetsuo Handa has reported that the system might basically livelock in
    OOM condition without triggering the OOM killer.
    
    The issue is caused by internal dependency of the direct reclaim on
    vmstat counter updates (via zone_reclaimable) which are performed from
    the workqueue context.  If all the current workers get assigned to an
    allocation request, though, they will be looping inside the allocator
    trying to reclaim memory but zone_reclaimable can see stalled numbers so
    it will consider a zone reclaimable even though it has been scanned way
    too much.  WQ concurrency logic will not consider this situation as a
    congested workqueue because it relies that worker would have to sleep in
    such a situation.  This also means that it doesn't try to spawn new
    workers or invoke the rescuer thread if the one is assigned to the
    queue.
    
    In order to fix this issue we need to do two things.  First we have to
    let wq concurrency code know that...
    373ccbe5
backing-dev.c 26.4 KB