Skip to content
  • Rabin Vincent's avatar
    mm: show migration types in show_mem · 377e4f16
    Rabin Vincent authored
    
    
    This is useful to diagnose the reason for page allocation failure for
    cases where there appear to be several free pages.
    
    Example, with this alloc_pages(GFP_ATOMIC) failure:
    
     swapper/0: page allocation failure: order:0, mode:0x0
     ...
     Mem-info:
     Normal per-cpu:
     CPU    0: hi:   90, btch:  15 usd:  48
     CPU    1: hi:   90, btch:  15 usd:  21
     active_anon:0 inactive_anon:0 isolated_anon:0
      active_file:0 inactive_file:84 isolated_file:0
      unevictable:0 dirty:0 writeback:0 unstable:0
      free:4026 slab_reclaimable:75 slab_unreclaimable:484
      mapped:0 shmem:0 pagetables:0 bounce:0
     Normal free:16104kB min:2296kB low:2868kB high:3444kB active_anon:0kB
     inactive_anon:0kB active_file:0kB inactive_file:336kB unevictable:0kB
     isolated(anon):0kB isolated(file):0kB present:331776kB mlocked:0kB
     dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:300kB
     slab_unreclaimable:1936kB kernel_stack:328kB pagetables:0kB unstable:0kB
     bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
     lowmem_reserve[]: 0 0
    
    Before the patch, it's hard (for me, at least) to say why all these free
    chunks weren't considered for allocation:
    
     Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 1*256kB 1*512kB
     1*1024kB 1*2048kB 3*4096kB = 16128kB
    
    After the patch, it's obvious that the reason is that all of these are
    in the MIGRATE_CMA (C) freelist:
    
     Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 1*256kB (C) 1*512kB
     (C) 1*1024kB (C) 1*2048kB (C) 3*4096kB (C) = 16128kB
    
    Signed-off-by: default avatarRabin Vincent <rabin.vincent@stericsson.com>
    Cc: Mel Gorman <mel@csn.ul.ie>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    377e4f16