mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
Translated:20140714 Linux slabtop command--Display Kernel Slab Cache Information.md
This commit is contained in:
parent
0774d97015
commit
715cb59516
@ -1,131 +1,131 @@
|
||||
Translating by GOLinux ...
|
||||
Linux slabtop command - Display Kernel Slab Cache Information
|
||||
Linux slabtop命令——显示内核片缓存信息
|
||||
================================================================================
|
||||
The Linux kernel needs to allocate memory for temporary objects such as task or device structures and inodes. The caching memory allocator manages caches of these types of objects. The modern Linux kernel implements this caching memory allocator to hold the caches called the slabs. Different types of slab caches are maintained by the slab allocator. This article concentrates on the slabtop command which shows real-time kernel slab cache information.
|
||||
|
||||
### 1. Command Usage: ###
|
||||
Linux内核需要为临时对象如任务或者设备结构和节点分配内存,缓存分配器管理着这些对象类型的缓存。现代Linux内核部署了该缓存分配器以持有缓存,称之为片。不同类型的片缓存由片分配器维护。本文集中讨论slabtop命令,该命令显示了实时内核片缓存信息。
|
||||
|
||||
The command is simple to use. Default execution does not mandate any arguments to the command. But it does require root privileges to access the kernel slab information. Executing the command as normal user gives following error:
|
||||
### 1. 命令用法: ###
|
||||
|
||||
该命令用起来很简单,默认执行时不要求任何参数。但是它要求root特权来读取内核片信息。以普通用户执行该命令会出现以下错误:
|
||||
|
||||
![Run slabtop as non-privileged user](http://linoxide.com/wp-content/uploads/2014/07/001.slabtop_normal_user.png)
|
||||
|
||||
You can run it by prepending “sudo” with slabtop. The default output looks like:
|
||||
你可以在前面设置“sudo”来运行该命令,默认输出见下图:
|
||||
|
||||
![Slabtop default output](http://linoxide.com/wp-content/uploads/2014/07/002.slabtop_output.png)
|
||||
|
||||
To quit from slabtop, just hit ‘q’ like you do for top command.
|
||||
要退出slabtop,只需敲‘q’,就像在top命令中那样。
|
||||
|
||||
### 2. Slabtop options: ###
|
||||
### 2. Slabtop选项: ###
|
||||
|
||||
#### 2.1 Display Interval: ####
|
||||
#### 2.1 显示间隔: ####
|
||||
|
||||
By default slabtop refreshes every 3 seconds. But if you want, you can provide the refreshing interval in seconds with -d or --delay=N option:
|
||||
默认情况下,slabtop每隔3秒刷新一次。但是,如果你想要调整,可以使用-d或者--delay=N选项来调整刷新间隔,以秒为单位:
|
||||
|
||||
![Custom delay interval 01](http://linoxide.com/wp-content/uploads/2014/07/003.slabtop_delay01.png)
|
||||
|
||||
![Custom delay interval 02](http://linoxide.com/wp-content/uploads/2014/07/004.slabtop_delay02.png)
|
||||
|
||||
#### 2.2 Sort criteria: ####
|
||||
#### 2.2 排序标准: ####
|
||||
|
||||
There are many fields in slabtop output. The -s or --sort=S option sorts the output according to the mentioned sort criteria. This option will be discussed in detail in the next section.
|
||||
在slabtop输出中有很多字段,-s或--sort=S选项可以根据指定的排序标准对这些字段排序。该选项将在下一节中详细讲述。
|
||||
|
||||
#### 2.3 Output once: ####
|
||||
#### 2.3 输出一次: ####
|
||||
|
||||
The -o or --once option does not refresh the output, instead it just throws the output once on STDOUT and exits.
|
||||
-o或--once选项不会刷新输出,它仅仅将一次输出结果丢给STDOUT,然后退出。
|
||||
|
||||
![Output once and exit](http://linoxide.com/wp-content/uploads/2014/07/005.slabtop_output_once.png)
|
||||
|
||||
#### 2.4 Version info: ####
|
||||
#### 2.4 版本信息: ####
|
||||
|
||||
The -V or --version displays the version of the command and exits.
|
||||
-V或--version选项显示命令的版本并退出。
|
||||
|
||||
![Slabtop version](http://linoxide.com/wp-content/uploads/2014/07/006.slabtop_version.png)
|
||||
|
||||
#### 2.5 Help: ####
|
||||
#### 2.5 帮助: ####
|
||||
|
||||
The common option, -h or --help displays usage of the command.
|
||||
常见选项,-h或--help显示命令的使用帮助。
|
||||
|
||||
![Slabtop help options](http://linoxide.com/wp-content/uploads/2014/07/007.slabtop_help.png)
|
||||
|
||||
### 3. Sort Criteria: ###
|
||||
### 3. 排序标准: ###
|
||||
|
||||
The sort criteria determines which slab caches are displayed on top. Following are the sort criteria for slabtop:
|
||||
排序标准确定了哪个片缓存显示在顶部,下面是slabtop的排序标准:
|
||||
|
||||
#### 3.1 ACTIVE: ####
|
||||
#### 3.1 活跃: ####
|
||||
|
||||
Caches can be sorted by number of active objects with “a”.
|
||||
缓存可以通过‘a’来对活跃对象编号进行排序。
|
||||
|
||||
![Sort by Active 01](http://linoxide.com/wp-content/uploads/2014/07/008.slabtop_sort_active01.png)
|
||||
|
||||
![Sort by Active 02](http://linoxide.com/wp-content/uploads/2014/07/009.slabtop_sort_active02.png)
|
||||
|
||||
#### 3.2 OBJ/SLAB: ####
|
||||
#### 3.2 对象/分片: ####
|
||||
|
||||
The Objects per Slab can be selected with “b”.
|
||||
每分片对象数可以使用“b”来选择。
|
||||
|
||||
![Sort by objects per slab 01](http://linoxide.com/wp-content/uploads/2014/07/010.slabtop_sort_objslab01.png)
|
||||
|
||||
![Sort by objects per slab 02](http://linoxide.com/wp-content/uploads/2014/07/011.slabtop_sort_objslab02.png)
|
||||
|
||||
#### 3.3 CACHE SIZE: ####
|
||||
#### 3.3 缓存大小: ####
|
||||
|
||||
For selecting cache size, you need to provide “c”.
|
||||
要选择缓存大小,你需要提供“c”选项。
|
||||
|
||||
![Sort by cache size 01](http://linoxide.com/wp-content/uploads/2014/07/012.slabtop_sort_cache_size01.png)
|
||||
|
||||
![Sort by cache size 02](http://linoxide.com/wp-content/uploads/2014/07/013.slabtop_sort_cache_size02.png)
|
||||
|
||||
#### 3.4 SLABS: ####
|
||||
#### 3.4 分片: ####
|
||||
|
||||
The number of slabs. Select it with “l”
|
||||
分片数量,使用“l”来选择。
|
||||
|
||||
![Sort by number of slabs 01](http://linoxide.com/wp-content/uploads/2014/07/014.slabtop_sort_slabs01.png)
|
||||
|
||||
![Sort by number of slabs 02](http://linoxide.com/wp-content/uploads/2014/07/015.slabtop_sort_slabs02.png)
|
||||
|
||||
#### 3.5 Active Slabs: ####
|
||||
#### 3.5 活跃分片: ####
|
||||
|
||||
The number of Active Slabs. (Note that this is different from number of Active Objects described above.) Use “v” to sort according to this criteria.
|
||||
活跃分片数量。(注意:这不同于上面讲得活跃对象数量。)使用“v”来根据该标准排序。
|
||||
|
||||
![Sort by Active Slabs 01](http://linoxide.com/wp-content/uploads/2014/07/016.slabtop_sort_active_slabs01.png)
|
||||
|
||||
![Sort by Active Slabs 02](http://linoxide.com/wp-content/uploads/2014/07/017.slabtop_sort_active_slabs02.png)
|
||||
|
||||
#### 3.6 NAME: ####
|
||||
#### 3.6 名称: ####
|
||||
|
||||
Name of cache. Corresponding character is “n”
|
||||
缓存名称。相关字符是“n”。
|
||||
|
||||
![Sort by cache name 01](http://linoxide.com/wp-content/uploads/2014/07/018.slabtop_sort_cache_name01.png)
|
||||
|
||||
![Sort by cache name 02](http://linoxide.com/wp-content/uploads/2014/07/019.slabtop_sort_cache_name02.png)
|
||||
|
||||
#### 3.7 OBJS: ####
|
||||
#### 3.7 对象: ####
|
||||
|
||||
To sort by number of objects, use “o”
|
||||
要根据对象数量排序,使用“o”。
|
||||
|
||||
![Sort by number of objects 01](http://linoxide.com/wp-content/uploads/2014/07/020.slabtop_sort_objectnunber01.png)
|
||||
|
||||
![Sort by number of objects 02](http://linoxide.com/wp-content/uploads/2014/07/021.slabtop_sort_objectnunber02.png)
|
||||
|
||||
#### 3.8 Pages Per Slab: ####
|
||||
#### 3.8 每分片页面数: ####
|
||||
|
||||
“p” will sort by pages per slab
|
||||
“p”将根据每分片页面数排序。
|
||||
|
||||
![Sort by pages per slab 01](http://linoxide.com/wp-content/uploads/2014/07/022.slabtop_sort_pagesperslab01.png)
|
||||
|
||||
![Sort by pages per slab 02](http://linoxide.com/wp-content/uploads/2014/07/023.slabtop_sort_pagesperslab02.png)
|
||||
|
||||
#### 3.9 OBJ SIZE: ####
|
||||
#### 3.9 对象大小: ####
|
||||
|
||||
The object size is sorted by “s”
|
||||
对象大小排序由“s”来指定。
|
||||
|
||||
![Sort by object size 01](http://linoxide.com/wp-content/uploads/2014/07/024.slabtop_sort_object_size01.png)
|
||||
|
||||
![Sort by object size 02](http://linoxide.com/wp-content/uploads/2014/07/025.slabtop_sort_object_size02.png)
|
||||
|
||||
#### 3.10 USE: ####
|
||||
#### 3.10 使用: ####
|
||||
|
||||
“u” sorts by the cache utilization.
|
||||
“u”选项根据缓存使用量排序。
|
||||
|
||||
![Sort by cache utilization 01](http://linoxide.com/wp-content/uploads/2014/07/026.slabtop_sort_cache_utilization01.png)
|
||||
|
||||
@ -135,6 +135,6 @@ The object size is sorted by “s”
|
||||
|
||||
via: http://linoxide.com/linux-command/kernel-slab-cache-information/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user