• M
    mm/memory-failure.c: fix page isolated count mismatch · 5db8a73a
    Minchan Kim 提交于
    Pages isolated for migration are accounted with the vmstat counters
    NR_ISOLATE_[ANON|FILE].  Callers of migrate_pages() are expected to
    increment these counters when pages are isolated from the LRU.  Once the
    pages have been migrated, they are put back on the LRU or freed and the
    isolated count is decremented.
    
    Memory failure is not properly accounting for pages it isolates causing
    the NR_ISOLATED counters to be negative.  On SMP builds, this goes
    unnoticed as negative counters are treated as 0 due to expected per-cpu
    drift.  On UP builds, the counter is treated by too_many_isolated() as a
    large value causing processes to enter D state during page reclaim or
    compaction.  This patch accounts for pages isolated by memory failure
    correctly.
    
    [mel@csn.ul.ie: rewrote changelog]
    Reviewed-by: NAndrea Arcangeli <aarcange@redhat.com>
    Signed-off-by: NMinchan Kim <minchan.kim@gmail.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Acked-by: NMel Gorman <mel@csn.ul.ie>
    Cc: <stable@kernel.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    5db8a73a
memory-failure.c 39.5 KB