SLABINFO(5) Linux Programmer’s Manual SLABINFO(5)
名前
/proc/slabinfo - カーネル slab アロケータの統計
書式
cat /proc/slabinfo
説明
Linux カーネルの内部で良く利用されるオブジェクト (バッファヘッド、i-ノ
ード、ディレクトリ・エントリなど) は、それぞれ自分用のキャッシュを備 え
ている。ファイル /proc/slabinfo はこれらの統計を与える。例を示す。
% cat /proc/slabinfo
slabinfo - version: 1.1
kmem_cache 60 78 100 2 2 1
blkdev_requests 5120 5120 96 128 128 1
mnt_cache 20 40 96 1 1 1
inode_cache 7005 14792 480 1598 1849 1
dentry_cache 5469 5880 128 183 196 1
filp 726 760 96 19 19 1
buffer_head 67131 71240 96 1776 1781 1
vm_area_struct 1204 1652 64 23 28 1
...
size-8192 1 17 8192 1 17 2
size-4096 41 73 4096 41 73 1
...
そ れぞれの slab キャッシュごとに、キャッシュの名前、現在アクティブなオ
ブジェクトの数、利用可能なオブジェクトの総数、各オブジェクトのサイズ (
バイト単位)、少なくとも一つのアクティブなオブジェクトを有するページの数
、アロケートされたページの総数、 slab あたりのページ数、が与えられて い
る。
な お、オブジェクトのアラインメントと slab キャッシュのオーバーヘッドと
により、オブジェクトは通常ページの内部にきっちりとは収められていない 。
利 用中のオブジェクトをひとつでも保持しているページは、利用中であるとみ
なされ、解放できない。
slab キャッシュ統計の機能を有効にしてコンパイルされたカーネルでは、出力
の最初の行に "(statistics)" と表示され、 5 つのカラムが追加される。それ
ぞれ、アクティブなオブジェクトの瞬間最大値、オブジェクトがアロケート さ
れ た回数、キャッシュの大きさが拡張された (新しいページがこのキャッシュ
に追加された) 回数、キャッシュの大きさが縮小された (使っていないペー ジ
が このキャッシュから削除された) 回数、新たなページをこのキャッシュにア
ロケートする際に起きたエラーの回数、である。 slab キャッシュ統計が使 え
ないカーネルでは、これらのカラムは表示されない。
SMP システムでは、出力の最初の行に "(SMP)" と表示され、各 slab ごとに 2
つのカラムが追加される。これらは各 CPU が持つローカルなキャッシュ (per-
CPU キャッシュ) の slab アロケーションポリシーを表示する (per-CPU キャ
ッシュは、オブジェクトをキャッシュからアロケートする際に CPU 間での同期
を 減少させるために設けられている)。最初のカラムは per-CPU 制限、すなわ
ち各 CPU ごとにキャッシュできるオブジェクトの最大数である。二番目のカラ
ムはバッチカウント、すなわち per-CPU キャッシュが空だったり一杯だったり
した場合に、グローバルなキャッシュと受け渡しできるフリーなオブジェク ト
の最大数である。
slab キャッシュ統計と SMP が両方有効になっている場合は、 per-CPU キャッ
シュの統計を表示する 4 つのカラムがさらに追加される。最初の 2 つは per-
CPU キャッシュのアロケーションヒットカウントとアロケーションミスカウン
トである。すなわち、あるオブジェクトをアロケートしたときに、それが per-
CPU キャッシュの内部に あった/なかった 回数である。続く 2 つは、per-CPU
キャッシュのフリーヒットカウントとミスカウントである。すなわち解放さ れ
たオブジェクトをグローバルなキャッシュにフラッシュする前に、 per-CPU キ
ャッシュの制限の範囲に 収まった/収まらなかった 回数である。
SMP において per-CPU slab キャッシュの制限値やバッチカウントを変更す る
には、以下のようにすればよい:
echo "cache_name limit batchcount" > /proc/slabinfo
ファイル
SLABINFO(5) Linux Programmer’s Manual SLABINFO(5)
NAME
/proc/slabinfo - Kernel slab allocator statistics
SYNOPSIS
cat /proc/slabinfo
DESCRIPTION
Frequently used objects in the Linux kernel (buffer heads, inodes, den-
tries, etc.) have their own cache. The file /proc/slabinfo gives
statistics. For example:
% cat /proc/slabinfo
slabinfo - version: 1.1
kmem_cache 60 78 100 2 2 1
blkdev_requests 5120 5120 96 128 128 1
mnt_cache 20 40 96 1 1 1
inode_cache 7005 14792 480 1598 1849 1
dentry_cache 5469 5880 128 183 196 1
filp 726 760 96 19 19 1
buffer_head 67131 71240 96 1776 1781 1
vm_area_struct 1204 1652 64 23 28 1
...
size-8192 1 17 8192 1 17 2
size-4096 41 73 4096 41 73 1
...
For each slab cache, the cache name, the number of currently active
objects, the total number of available objects, the size of each object
in bytes, the number of pages with at least one active object, the
total number of allocated pages, and the number of pages per slab are
given.
Note that because of object alignment and slab cache overhead, objects
are not normally packed tightly into pages. Pages with even one in-use
object are considered in-use and cannot be freed.
Kernels compiled with slab cache statistics will also have "(statis-
tics)" in the first line of output, and will have 5 additional columns,
namely: the high water mark of active objects; the number of times
objects have been allocated; the number of times the cache has grown
(new pages added to this cache); the number of times the cache has been
reaped (unused pages removed from this cache); and the number of times
there was an error allocating new pages to this cache. If slab cache
statistics are not enabled for this kernel, these columns will not be
shown.
SMP systems will also have "(SMP)" in the first line of output, and
will have two additional columns for each slab, reporting the slab
allocation policy for the CPU-local cache (to reduce the need for
inter-CPU synchronization when allocating objects from the cache). The
first column is the per-CPU limit: the maximum number of objects that
will be cached for each CPU. The second column is the batchcount: the
maximum number of free objects in the global cache that will be trans-
ferred to the per-CPU cache if it is empty, or the number of objects to
be returned to the global cache if the per-CPU cache is full.
If both slab cache statistics and SMP are defined, there will be four
additional columns, reporting the per-CPU cache statistics. The first
two are the per-CPU cache allocation hit and miss counts: the number of
times an object was or was not available in the per-CPU cache for allo-
cation. The next two are the per-CPU cache free hit and miss counts:
the number of times a freed object could or could not fit within the
per-CPU cache limit, before flushing objects to the global cache.
It is possible to tune the SMP per-CPU slab cache limit and batchcount
via:
echo "cache_name limit batchcount" > /proc/slabinfo
FILES
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa