• Lin Feng's avatar
    mm: vmstat.c: make extfrag_index show more pretty · a9970586
    Lin Feng authored
    fragmentation_index may return -1000 and the corresponding formated
    value showed by seq_printf will take a negative signatrue, but other
    positive formated values don't take a positive signatrue, so the output
    becomes unaligned.
    
    before:
      Node 0, zone      DMA -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
      Node 0, zone    DMA32 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
      Node 0, zone   Normal -1.000 -1.000 -1.000 -1.000 0.931 0.966 0.983 0.992 0.996 0.998 0.999
    
    after this patch:
      Node 0, zone      DMA -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
      Node 0, zone    DMA32 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
      Node 0, zone   Normal -1.000 -1.000 -1.000 -1.000  0.931  0.966  0.983  0.992  0.996  0.998  0.999
    
    Link: https://lkml.kernel.org/r/20211019103241.134797-1-linf@wangsu.comSigned-off-by: default avatarLin Feng <linf@wangsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    a9970586
vmstat.c 54.6 KB