Slub Memory Allocator -12- (slabinfo)

 

디버깅 툴 빌드

$ gcc -o slabinfo tools/vm/slabinfo.c

 

사용법

$ sudo ./slabinfo -h
slabinfo 4/15/2011. (c) 2007 sgi/(c) 2011 Linux Foundation.

slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]
-a|--aliases           Show aliases
-A|--activity          Most active slabs first
-d<options>|--debug=<options> Set/Clear Debug options
-D|--display-active    Switch line format to activity
-e|--empty             Show empty slabs
-f|--first-alias       Show first alias
-h|--help              Show usage information
-i|--inverted          Inverted list
-l|--slabs             Show slabs
-n|--numa              Show NUMA information
-o|--ops		Show kmem_cache_ops
-s|--shrink            Shrink slabs
-r|--report		Detailed report on single slabs
-S|--Size              Sort by size
-t|--tracking          Show alloc/free information
-T|--Totals            Show summary information
-v|--validate          Validate slabs
-z|--zero              Include empty slabs
-1|--1ref              Single reference

Valid debug options (FZPUT may be combined)
a / A          Switch on all debug options (=FZUP)
-              Switch off all debug options
f / F          Sanity Checks (SLAB_DEBUG_FREE)
z / Z          Redzoning
p / P          Poisoning
u / U          Tracking
t / T          Tracing

 

slub 정보

arm

$ sudo ./slabinfo
Name                   Objects Objsize    Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
:at-0000016                256      16     4.0K          0/0/1  256 0   0 100 *a
:at-0000032               3968      32   126.9K         22/0/9  128 0   0 100 *a
:at-0000040                408      40    16.3K          0/0/4  102 0   0  99 *a
:at-0000064              32128      64     2.0M       454/0/48   64 0   0 100 *a
:at-0000104                156     104    16.3K          0/0/4   39 0   0  99 *a
:t-0000024                 680      24    16.3K          0/0/4  170 0   0  99 *
:t-0000032                9472      32   303.1K        12/0/62  128 0   0 100 *
:t-0000040                 612      40    24.5K          0/0/6  102 0   0  99 *
:t-0000064               12483      64   802.8K       128/1/68   64 0   0  99 *
:t-0000088                2714      88   241.6K        15/0/44   46 0   0  98 *
:t-0000096                 168      96    16.3K          0/0/4   42 0   0  98 *
:t-0000104                6552     104   688.1K       158/0/10   39 0   0  99 *
:t-0000128                2240     128   286.7K        15/0/55   32 0   0 100 *
:t-0000192                4305     192   839.6K       152/0/53   21 0   0  98 *
:t-0000256                 192     256    49.1K          3/0/9   16 0   0 100 *
:t-0000320                 954     320   335.8K        12/5/29   25 1  12  90 *A
:t-0000384                  84     384    32.7K          0/0/4   21 1   0  98 *A
:t-0000512                 720     512   368.6K        26/0/19   16 1   0 100 *
:t-0000640                  50     640    32.7K          1/0/1   25 2   0  97 *A
:t-0000960                 187     936   180.2K         1/0/10   17 2   0  97 *A
:t-0001024                 176    1024   180.2K          4/0/7   16 2   0 100 *
:t-0002048                 176    2048   360.4K          2/0/9   16 3   0 100 *
:t-0004032                 153    4032   655.3K         5/2/15    8 3  10  94 *
:t-0004096                  64    4096   262.1K          0/0/8    8 3   0 100 *
anon_vma                  2124     104   241.6K        10/0/49   36 0   0  91
bdev_cache                  72     848    65.5K          0/0/4   18 2   0  93 Aa
biovec-128                  84    1536   131.0K          0/0/4   21 3   0  98 A
biovec-256                  10    3072    32.7K          0/0/1   10 3   0  93 A
biovec-64                   84     768    65.5K          0/0/4   21 2   0  98 A
blkdev_queue                34    1824    65.5K          0/0/2   17 3   0  94
blkdev_requests            204     232    49.1K         0/0/12   17 0   0  96
dentry                   20500     200     4.1M      1012/0/13   20 0   0  97 a
ext4_groupinfo_4k          253     172    45.0K         10/0/1   23 0   0  96 a
ext4_inode_cache         10686    1232    13.4M       400/0/11   26 3   0  97 a
fat_cache                  170      20     4.0K          0/0/1  170 0   0  83 a
fat_inode_cache             60     776    49.1K          1/0/2   20 2   0  94 a
file_lock_cache            100     160    16.3K          0/0/4   25 0   0  97
fscache_cookie_jar          32     124     4.0K          0/0/1   32 0   0  96
ftrace_event_file          595      48    28.6K          6/0/1   85 0   0  99
idr_layer_cache            270    1068   294.9K          5/0/4   30 3   0  97
inode_cache               5589     584     3.3M       191/0/16   27 2   0  96 a
jbd2_journal_handle        292      56    16.3K          0/0/4   73 0   0  99 a
jbd2_transaction_s         189     176    36.8K          0/0/9   21 0   0  90 Aa
kmalloc-8192                24    8192   196.6K          1/0/5    4 3   0 100
kmem_cache                 128     116    16.3K          1/0/3   32 0   0  90 A
kmem_cache_node            128      68    16.3K          1/0/3   32 0   0  53 A
mm_struct                  112     536    65.5K          0/0/4   28 2   0  91 A
mqueue_inode_cache          18     840    16.3K          0/0/1   18 2   0  92 A
nfs_commit_data             18     448     8.1K          0/0/1   18 1   0  98 A
posix_timers_cache          18     216     4.0K          0/0/1   18 0   0  94
proc_inode_cache           546     616   344.0K         4/0/17   26 2   0  97 a
radix_tree_node           2106     304   663.5K        71/0/10   26 1   0  96 a
shmem_inode_cache          644     696   458.7K         20/0/8   23 2   0  97
sighand_cache              184    1372   262.1K          0/0/8   23 3   0  96 A
sigqueue                   112     144    16.3K          0/0/4   28 0   0  98
sock_inode_cache           100     616    65.5K          0/0/4   25 2   0  93 Aa
taskstats                   24     328     8.1K          0/0/1   24 1   0  96
TCP                         68    1816   131.0K          0/0/4   17 3   0  94 A
UDP                         64     960    65.5K          0/0/4   16 2   0  93 A

x86

$ sudo ./slabinfo 
Name                   Objects Objsize    Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
:at-0000032              22272      32   712.7K       160/0/14  128 0   0 100 *a
:at-0000040                306      40    12.2K          0/0/3  102 0   0  99 *a
:at-0000064                256      60    16.3K          0/0/4   64 0   0  93 *a
:at-0000192                 84     160    16.3K          0/0/4   21 0   0  82 *Aa
:t-0000008                4607       8    36.8K          5/1/4  512 0  11  99 *
:t-0000016               10936      16   184.3K       33/13/12  256 0  28  94 *
:t-0000024                 850      24    20.4K          1/0/4  170 0   0  99 *
:t-0000032               20019      32   667.6K      127/52/36  128 0  31  95 *
:t-0000040                 292      36    16.3K          3/3/1  102 0  75  64 *
:t-0000048                2760      48   143.3K         35/7/0   85 0  20  92 *
:t-0000064                5568      64   356.3K        39/0/48   64 0   0 100 *
:t-0000096               19740      96     1.9M       426/0/44   42 0   0  98 *
:t-0000128                1615     128   237.5K       34/24/24   32 0  41  87 *
:t-0000192                8043     192     1.5M       360/0/23   21 0   0  98 *
:t-0000256                 760     256   241.6K       43/30/16   16 0  50  80 *
:t-0000384                  63     384    24.5K          0/0/3   21 1   0  98 *A
:t-0000448                 149     448    73.7K          3/3/6   18 1  33  90 *A
:t-0000512                1533     512   868.3K       84/44/22   16 1  41  90 *
:t-0000640                  16     640    32.7K          2/2/0   25 2 100  31 *A
:t-0000704                 758     704   573.4K       21/10/14   23 2  28  93 *A
:t-0000768                  42     768    32.7K          0/0/2   21 2   0  98 *A
:t-0000832                  15     812    32.7K          2/2/0   19 2 100  37 *A
:t-0001536                   2    1536    32.7K          1/1/0   21 3 100   9 *A
:t-0003072                  30    3072    98.3K          0/0/3   10 3   0  93 *
:t-0004096                 135    4096   589.8K          9/3/9    8 3  16  93 *
anon_vma                  8467      44   413.6K       69/17/32   85 0  16  90 
bdev_cache                  30     476    32.7K          4/4/0   16 1 100  43 Aa
blkdev_queue                26    1140    65.5K          2/2/0   28 3 100  45 
blkdev_requests            119     232    28.6K          0/0/7   17 0   0  96 
buffer_head              89279      56     5.0M      1213/0/10   73 0   0  99 a
dentry                   83872     128    10.7M      2601/0/20   32 0   0 100 a
dmaengine-unmap-128          1    1040    32.7K          1/1/0   30 3 100   3 A
dmaengine-unmap-256          1    2064    32.7K          1/1/0   15 3 100   6 A
ext4_allocation_context      117     104    12.2K          0/0/3   39 0   0  99 a
ext4_groupinfo_4k          384     112    45.0K         11/1/0   36 0   9  95 a
ext4_inode_cache         54120     652    36.9M       2250/0/5   24 2   0  95 a
ext4_prealloc_space          4      68    12.2K          3/3/0   56 0 100   2 a
file_lock_cache            144     112    16.3K          0/0/4   36 0   0  98 
fuse_inode                   1     428     8.1K          1/1/0   18 1 100   5 A
hugetlbfs_inode_cache        2     336    16.3K          2/2/0   23 1 100   4 
idr_layer_cache            392    1068   458.7K          9/1/5   30 3   7  91 
inode_cache              13731     336     4.8M        592/0/5   23 1   0  94 a
isofs_inode_cache           13     364     8.1K          1/1/0   22 1 100  57 a
jbd2_revoke_table_s          2      12     4.0K          1/1/0  256 0 100   0 a
kernfs_node_cache        17160      72     1.2M       310/13/0   56 0   4  97 
kmalloc-1024               560    1024   573.4K         28/0/7   16 2   0 100 
kmalloc-2048               208    2048   425.9K          6/0/7   16 3   0 100 
kmalloc-8192                76    8192   622.5K         15/0/4    4 3   0 100 
kmem_cache                  97     128    20.4K          5/3/0   32 0  60  60 A
kmem_cache_node             97      32    12.2K          3/3/0  128 0 100  25 A
mqueue_inode_cache           1     520    16.3K          1/1/0   28 2 100   3 A
proc_inode_cache          4081     364     1.5M       160/6/26   22 1   3  97 a
radix_tree_node           6214     304     1.9M        233/0/6   26 1   0  96 a
shmem_inode_cache         1142     376   466.9K         57/9/0   21 1  15  91 
sighand_cache              201    1300   327.6K          5/5/5   24 3  50  79 A
sigqueue                   112     144    16.3K          0/0/4   28 0   0  98 
sock_inode_cache           701     364   278.5K        24/9/10   21 1  26  91 Aa
task_struct                369    1564   753.6K        15/14/8   20 3  60  76 
taskstats                   49     328    32.7K          4/4/0   24 1 100  49 
TCP                          2    1372    65.5K          2/2/0   23 3 100   4 A
TCPv6                        4    1488    98.3K          3/3/0   21 3 100   6 A
UDP                         69     660    49.1K          0/0/3   23 2   0  92 A
UDPv6                        3     776    32.7K          2/2/0   19 2 100   7 A

 

slub alias

arm
$ sudo ./slabinfo -a

:at-0000016  <- discard_entry f2fs_inode_entry jbd2_revoke_table_s inmem_page_entry free_nid f2fs_ino_entry sit_entry_set
:at-0000024  <- nat_entry nat_entry_set
:at-0000032  <- ext4_extent_status jbd2_revoke_record_s
:at-0000040  <- ext4_free_data ext4_io_end
:at-0000064  <- mmcblk0p6 jbd2_journal_head buffer_head
:at-0000104  <- ext4_allocation_context ext4_prealloc_space
:t-0000024   <- ip_fib_alias dnotify_struct jbd2_inode nsproxy scsi_data_buffer
:t-0000032   <- ftrace_event_field fanotify_event_info dmaengine-unmap-2 secpath_cache anon_vma_chain sd_ext_cdb ip_fib_trie tcp_bind_bucket ext4_system_zone
:t-0000040   <- eventpoll_pwq page->ptl
:t-0000064   <- nfs_page pid kmalloc-64 kiocb uid_cache fasync_cache file_lock_ctx cfq_io_cq
:t-0000088   <- flow_cache vm_area_struct
:t-0000096   <- dnotify_mark fsnotify_mark inotify_inode_mark
:t-0000104   <- task_delay_info kernfs_node_cache
:t-0000128   <- ip_mrt_cache blkdev_ioc sgpool-8 pid_namespace fs_cache inet_peer_cache kmalloc-128 ip_dst_cache eventpoll_epi cred_jar
:t-0000192   <- bio-0 key_jar skbuff_head_cache ip4-frags request_sock_TCP rpc_tasks kmalloc-192 biovec-16
:t-0000256   <- mnt_cache sgpool-16 pool_workqueue kmalloc-256 files_cache
:t-0000320   <- xfrm_dst_cache filp
:t-0000384   <- skbuff_fclone_cache dio
:t-0000512   <- sgpool-32 kmalloc-512
:t-0000640   <- nfs_write_data kioctx nfs_read_data
:t-0000960   <- RAW PING signal_cache
:t-0001024   <- UNIX kmalloc-1024 sgpool-64
:t-0002048   <- kmalloc-2048 sgpool-128 rpc_buffers
:t-0004032   <- task_struct net_namespace
:t-0004096   <- names_cache kmalloc-4096

 

x86
$ sudo ./slabinfo -a
:at-0000032  <- ext4_extent_status jbd2_revoke_record_s jbd2_journal_handle
:at-0000040  <- ext4_io_end ext4_free_data
:at-0000064  <- sda1 jbd2_journal_head
:at-0000192  <- dquot jbd2_transaction_s
:t-0000008   <- ecryptfs_file_cache kmalloc-8
:t-0000016   <- ecryptfs_dentry_info_cache kmalloc-16
:t-0000024   <- nsproxy dnotify_struct ip_fib_alias dm_io khugepaged_mm_slot Acpi-Namespace ksm_mm_slot scsi_data_buffer ksm_stable_node jbd2_inode ext4_system_zone
:t-0000032   <- sd_ext_cdb ip_fib_trie uhci_urb_priv ftrace_event_field io anon_vma_chain fib6_nodes kmalloc-32 secpath_cache Acpi-Parse tcp_bind_bucket fasync_cache ksm_rmap_item ecryptfs_key_sig_cache fanotify_event_info dmaengine-unmap-2
:t-0000040   <- eventpoll_pwq fanotify_perm_event_info
:t-0000048   <- ftrace_event_file Acpi-State Acpi-Operand Acpi-ParseExt
:t-0000056   <- blkdev_integrity fsnotify_mark
:t-0000064   <- fs_cache dnotify_mark kmalloc-64 cfq_io_cq task_delay_info inotify_inode_mark ecryptfs_global_auth_tok_cache kiocb blkdev_ioc pid uid_cache
:t-0000096   <- kmalloc-96 vm_area_struct
:t-0000128   <- bio_integrity_payload eventpoll_epi scsi_sense_cache inet_peer_cache ip6_mrt_cache key_jar kmalloc-128 btree_node ip_dst_cache cred_jar ecryptfs_key_tfm_cache ip_mrt_cache
:t-0000192   <- kmalloc-192 mnt_cache biovec-16 skbuff_head_cache dmaengine-unmap-16 sgpool-8 request_sock_TCPv6 request_sock_TCP filp bio-0
:t-0000256   <- pool_workqueue user_namespace ip6_dst_cache dm_rq_target_io scsi_cmd_cache kmalloc-256 files_cache
:t-0000384   <- dio sgpool-16
:t-0000448   <- mm_struct skbuff_fclone_cache kioctx
:t-0000512   <- kmalloc-512 task_xstate
:t-0000576   <- ecryptfs_key_record_cache ecryptfs_sb_cache
:t-0000640   <- PING RAW
:t-0000704   <- signal_cache UNIX
:t-0000768   <- sgpool-32 biovec-64
:t-0000832   <- PINGv6 ecryptfs_auth_tok_list_item RAWv6
:t-0001536   <- sgpool-64 biovec-128
:t-0003072   <- biovec-256 sgpool-128 net_namespace
:t-0004096   <- kmalloc-4096 names_cache ecryptfs_headers ecryptfs_xattr_cache

 

slub 요약

arm

$ sudo ./slabinfo -T
Slabcache Totals
----------------
Slabcaches :  71      Aliases  : 118->49  Active:  59
Memory used:  32.5M   # Loss   : 741.4K   MRatio:     2%
# Objects  : 125.2K   # PartObj:      9   ORatio:     0%

Per Cache    Average         Min         Max       Total
---------------------------------------------------------
#Objects        2.1K          10       32.1K      125.2K
#Slabs            58           1        1.0K        3.4K
#PartSlab          0           0           2           2
%PartSlab         0%          0%         10%          0%
PartObjs           0           0           9           9
% PartObj         0%          0%          5%          0%
Memory        550.9K        4.0K       13.4M       32.5M
Used          538.3K        3.4K       13.1M       31.7M
Loss           12.5K           0      302.4K      741.4K

Per Object   Average         Min         Max
---------------------------------------------
Memory           255          16        8.1K
User             253          16        8.1K
Loss               1           0          64

x86

$ ./slabinfo -T
Slabcache Totals
----------------
Slabcaches :  97      Aliases  : 160->70  Active:  63
Memory used:  76.0M   # Loss   :   3.3M   MRatio:     4%
# Objects  : 383.3K   # PartObj:  15.3K   ORatio:     4%

Per Cache    Average         Min         Max       Total
---------------------------------------------------------
#Objects        6.0K           1       89.2K      383.3K
#Slabs           151           1        2.6K        9.5K
#PartSlab          5           0          57         341
%PartSlab        38%          0%        100%          3%
PartObjs           4           0        6.4K       15.3K
% PartObj        36%          0%        100%          4%
Memory          1.2M        4.0K       36.9M       76.0M
Used            1.1M          24       35.2M       72.6M
Loss           52.9K           0        1.6M        3.3M

Per Object   Average         Min         Max
---------------------------------------------
Memory           190           8        8.1K
User             189           8        8.1K
Loss               1           0          56

 

참고

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.