1. 16 3月, 2016 1 次提交
  2. 06 11月, 2015 7 次提交
    • S
      tools/vm/slabinfo: cosmetic globals cleanup · 2cee611a
      Sergey Senozhatsky 提交于
      checkpatch.pl complains about globals being explicitly zeroed
      out: "ERROR: do not initialise globals to 0 or NULL".
      
      New globals, introduced in this patch set, have no explicit 0
      initialization; clean up the old ones to make it less hairy.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2cee611a
    • S
      tools/vm/slabinfo: output sizes in bytes · a8ea0bf1
      Sergey Senozhatsky 提交于
      Introduce "-B|--Bytes" opt to disable store_size() dynamic
      size scaling and report size in bytes instead.
      
      This `expands' the interface a bit, it's impossible to use
      printf("%6s") anymore to output sizes.
      
      Example:
      
      slabinfo -X -N 2
       Slabcache Totals
       ----------------
       Slabcaches :              91   Aliases  :         119->69   Active:     63
       Memory used:       199798784   # Loss   :        10689376   MRatio:     5%
       # Objects  :          324301   # PartObj:           18151   ORatio:     5%
      
       Per Cache         Average              Min              Max            Total
       ----------------------------------------------------------------------------
       #Objects             5147                1            89068           324301
       #Slabs                199                1             3886            12537
       #PartSlab              12                0              240              778
       %PartSlab             32%               0%             100%               6%
       PartObjs                5                0             4569            18151
       % PartObj             26%               0%             100%               5%
       Memory            3171409             8192        127336448        199798784
       Used              3001736              160        121429728        189109408
       Loss               169672                0          5906720         10689376
      
       Per Object        Average              Min              Max
       -----------------------------------------------------------
       Memory                585                8             8192
       User                  583                8             8192
       Loss                    2                0               64
      
       Slabs sorted by size
       --------------------
       Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736       127336448      3871/0/15   18 3   0  95 a
       dentry                   89068     288        26058752      3164/0/17   28 1   0  98 a
      
       Slabs sorted by loss
       --------------------
       Name                   Objects Objsize            Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736         5906720      3871/0/15   18 3   0  95 a
       inode_cache              11628     864          537472        642/0/4   18 2   0  94 a
      
      Besides, store_size() does not use powers of two for G/M/K
      
          if (value > 1000000000UL) {
                  divisor = 100000000UL;
                  trailer = 'G';
          } else if (value > 1000000UL) {
                  divisor = 100000UL;
                  trailer = 'M';
          } else if (value > 1000UL) {
                  divisor = 100;
                  trailer = 'K';
          }
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a8ea0bf1
    • S
      tools/vm/slabinfo: introduce extended totals mode · 016c6cdf
      Sergey Senozhatsky 提交于
      Add "-X|--Xtotals" opt to output extended totals summary,
      which includes:
      -- totals summary
      -- slabs sorted by size
      -- slabs sorted by loss (waste)
      
      Example:
      =======
      
      slabinfo --X -N 1
        Slabcache Totals
        ----------------
        Slabcaches :  91      Aliases  : 120->69  Active:  65
        Memory used: 568.3M   # Loss   :  30.4M   MRatio:     5%
        # Objects  : 920.1K   # PartObj: 161.2K   ORatio:    17%
      
        Per Cache    Average         Min         Max       Total
        ---------------------------------------------------------
        #Objects       14.1K           1      227.8K      920.1K
        #Slabs           533           1       11.7K       34.7K
        #PartSlab         86           0        4.3K        5.6K
        %PartSlab        24%          0%        100%         16%
        PartObjs          17           0      129.3K      161.2K
        % PartObj        17%          0%        100%         17%
        Memory          8.7M        8.1K      384.7M      568.3M
        Used            8.2M         160      366.5M      537.9M
        Loss          468.8K           0       18.2M       30.4M
      
        Per Object   Average         Min         Max
        ---------------------------------------------
        Memory           587           8        8.1K
        User             584           8        8.1K
        Loss               2           0          64
      
        Slabs sorted by size
        ----------------------
        Name                   Objects Objsize    Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
        ext4_inode_cache        211142    1736   384.7M    11732/40/10   18 3   0  95 a
      
        Slabs sorted by loss
        ----------------------
        Name                   Objects Objsize    Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
        ext4_inode_cache        211142    1736    18.2M    11732/40/10   18 3   0  95 a
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      016c6cdf
    • S
      tools/vm/slabinfo: fix alternate opts names · 0d00bf58
      Sergey Senozhatsky 提交于
      Fix mismatches between usage() output and real opts[] options.  Add
      missing alternative opt names, e.g., '-S' had no '--Size' opts[] entry,
      etc.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0d00bf58
    • S
      tools/vm/slabinfo: sort slabs by loss · 2651f6e7
      Sergey Senozhatsky 提交于
      Introduce opt "-L|--sort-loss" to sort and output slabs by
      loss (waste) in slabcache().
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2651f6e7
    • S
      tools/vm/slabinfo: limit the number of reported slabs · 4980a963
      Sergey Senozhatsky 提交于
      Introduce opt "-N|--lines=K" to limit the number of slabs
      being reported in output_slabs().
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4980a963
    • S
      tools/vm/slabinfo: use getopt no_argument/optional_argument · 2b100755
      Sergey Senozhatsky 提交于
      This patchset adds 'extended' slabinfo mode that provides additional
      information:
      
       -- totals summary
       -- slabs sorted by size
       -- slabs sorted by loss (waste)
      
      The patches also introduces several new slabinfo options to limit the
      number of slabs reported, sort slabs by loss (waste); and some fixes.
      
      Extended output example (slabinfo -X -N 2):
      
       Slabcache Totals
       ----------------
       Slabcaches :              91   Aliases  :         119->69   Active:     63
       Memory used:       199798784   # Loss   :        10689376   MRatio:     5%
       # Objects  :          324301   # PartObj:           18151   ORatio:     5%
      
       Per Cache         Average              Min              Max            Total
       ----------------------------------------------------------------------------
       #Objects             5147                1            89068           324301
       #Slabs                199                1             3886            12537
       #PartSlab              12                0              240              778
       %PartSlab             32%               0%             100%               6%
       PartObjs                5                0             4569            18151
       % PartObj             26%               0%             100%               5%
       Memory            3171409             8192        127336448        199798784
       Used              3001736              160        121429728        189109408
       Loss               169672                0          5906720         10689376
      
       Per Object        Average              Min              Max
       -----------------------------------------------------------
       Memory                585                8             8192
       User                  583                8             8192
       Loss                    2                0               64
      
       Slabs sorted by size
       --------------------
       Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736       127336448      3871/0/15   18 3   0  95 a
       dentry                   89068     288        26058752      3164/0/17   28 1   0  98 a
      
       Slabs sorted by loss
       --------------------
       Name                   Objects Objsize            Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736         5906720      3871/0/15   18 3   0  95 a
       inode_cache              11628     864          537472        642/0/4   18 2   0  94 a
      
      The last patch in the series addresses Linus' comment from
      http://marc.info/?l=linux-mm&m=144148518703321&w=2
      
      (well, it's been some time. sorry.)
      
      gnuplot script takes the slabinfo records file, where every record is a `slabinfo -X'
      output. So the basic workflow is, for example, as follows:
      
              while [ 1 ]; do slabinfo -X -N 2 >> stats; sleep 1; done
              ^C
              slabinfo-gnuplot.sh stats
      
      The last command will produce 3 png files (and 3 stats files)
      -- graph of slabinfo totals
      -- graph of slabs by size
      -- graph of slabs by loss
      
      It's also possible to select a range of records for plotting (a range of collected
      slabinfo outputs) via `-r 10,100` (for example); and compare totals from several
      measurements (to visially compare slabs behaviour (10,50 range)) using
      pre-parsed totals files:
              slabinfo-gnuplot.sh -r 10,50 -t stats-totals1 .. stats-totals2
      
      This also, technically, supports ktest. Upload new slabinfo to target,
      collect the stats and give the resulting stats file to slabinfo-gnuplot
      
      This patch (of 8):
      
      Use getopt constants in `struct option' ->has_arg instead of numerical
      representations.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2b100755
  3. 03 7月, 2012 1 次提交
  4. 29 3月, 2012 1 次提交
  5. 19 10月, 2011 1 次提交
  6. 20 8月, 2011 1 次提交
  7. 02 7月, 2011 1 次提交
  8. 06 11月, 2010 1 次提交
  9. 23 9月, 2009 1 次提交
  10. 05 7月, 2008 1 次提交
  11. 02 5月, 2008 1 次提交
  12. 27 4月, 2008 1 次提交
  13. 22 2月, 2008 1 次提交
  14. 08 2月, 2008 1 次提交
    • C
      SLUB: Support for performance statistics · 8ff12cfc
      Christoph Lameter 提交于
      The statistics provided here allow the monitoring of allocator behavior but
      at the cost of some (minimal) loss of performance. Counters are placed in
      SLUB's per cpu data structure. The per cpu structure may be extended by the
      statistics to grow larger than one cacheline which will increase the cache
      footprint of SLUB.
      
      There is a compile option to enable/disable the inclusion of the runtime
      statistics and its off by default.
      
      The slabinfo tool is enhanced to support these statistics via two options:
      
      -D 	Switches the line of information displayed for a slab from size
      	mode to activity mode.
      
      -A	Sorts the slabs displayed by activity. This allows the display of
      	the slabs most important to the performance of a certain load.
      
      -r	Report option will report detailed statistics on
      
      Example (tbench load):
      
      slabinfo -AD		->Shows the most active slabs
      
      Name                   Objects    Alloc     Free   %Fast
      skbuff_fclone_cache         33 111953835 111953835  99  99
      :0000192                  2666  5283688  5281047  99  99
      :0001024                   849  5247230  5246389  83  83
      vm_area_struct            1349   119642   118355  91  22
      :0004096                    15    66753    66751  98  98
      :0000064                  2067    25297    23383  98  78
      dentry                   10259    28635    18464  91  45
      :0000080                 11004    18950     8089  98  98
      :0000096                  1703    12358    10784  99  98
      :0000128                   762    10582     9875  94  18
      :0000512                   184     9807     9647  95  81
      :0002048                   479     9669     9195  83  65
      anon_vma                   777     9461     9002  99  71
      kmalloc-8                 6492     9981     5624  99  97
      :0000768                   258     7174     6931  58  15
      
      So the skbuff_fclone_cache is of highest importance for the tbench load.
      Pretty high load on the 192 sized slab. Look for the aliases
      
      slabinfo -a | grep 000192
      :0000192     <- xfs_btree_cur filp kmalloc-192 uid_cache tw_sock_TCP
      	request_sock_TCPv6 tw_sock_TCPv6 skbuff_head_cache xfs_ili
      
      Likely skbuff_head_cache.
      
      
      Looking into the statistics of the skbuff_fclone_cache is possible through
      
      slabinfo skbuff_fclone_cache	->-r option implied if cache name is mentioned
      
      
      .... Usual output ...
      
      Slab Perf Counter       Alloc     Free %Al %Fr
      --------------------------------------------------
      Fastpath             111953360 111946981  99  99
      Slowpath                 1044     7423   0   0
      Page Alloc                272      264   0   0
      Add partial                25      325   0   0
      Remove partial             86      264   0   0
      RemoteObj/SlabFrozen      350     4832   0   0
      Total                111954404 111954404
      
      Flushes       49 Refill        0
      Deactivate Full=325(92%) Empty=0(0%) ToHead=24(6%) ToTail=1(0%)
      
      Looks good because the fastpath is overwhelmingly taken.
      
      
      skbuff_head_cache:
      
      Slab Perf Counter       Alloc     Free %Al %Fr
      --------------------------------------------------
      Fastpath              5297262  5259882  99  99
      Slowpath                 4477    39586   0   0
      Page Alloc                937      824   0   0
      Add partial                 0     2515   0   0
      Remove partial           1691      824   0   0
      RemoteObj/SlabFrozen     2621     9684   0   0
      Total                 5301739  5299468
      
      Deactivate Full=2620(100%) Empty=0(0%) ToHead=0(0%) ToTail=0(0%)
      
      
      Descriptions of the output:
      
      Total:		The total number of allocation and frees that occurred for a
      		slab
      
      Fastpath:	The number of allocations/frees that used the fastpath.
      
      Slowpath:	Other allocations
      
      Page Alloc:	Number of calls to the page allocator as a result of slowpath
      		processing
      
      Add Partial:	Number of slabs added to the partial list through free or
      		alloc (occurs during cpuslab flushes)
      
      Remove Partial:	Number of slabs removed from the partial list as a result of
      		allocations retrieving a partial slab or by a free freeing
      		the last object of a slab.
      
      RemoteObj/Froz:	How many times were remotely freed object encountered when a
      		slab was about to be deactivated. Frozen: How many times was
      		free able to skip list processing because the slab was in use
      		as the cpuslab of another processor.
      
      Flushes:	Number of times the cpuslab was flushed on request
      		(kmem_cache_shrink, may result from races in __slab_alloc)
      
      Refill:		Number of times we were able to refill the cpuslab from
      		remotely freed objects for the same slab.
      
      Deactivate:	Statistics how slabs were deactivated. Shows how they were
      		put onto the partial list.
      
      In general fastpath is very good. Slowpath without partial list processing is
      also desirable. Any touching of partial list uses node specific locks which
      may potentially cause list lock contention.
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      8ff12cfc
  15. 25 1月, 2008 1 次提交
  16. 17 10月, 2007 1 次提交
  17. 10 8月, 2007 1 次提交
  18. 18 5月, 2007 1 次提交
  19. 17 5月, 2007 1 次提交
  20. 10 5月, 2007 1 次提交
  21. 08 5月, 2007 1 次提交