SlideShare a Scribd company logo
了解IO协议栈

核心系统数据库组 余锋
 http://yufeng.info
     @淘宝褚霸
     2012-03-18
                      1
提纲

•   IO子系统架构图
•   IO子系统各层分解
•   IO请求事件跟踪点
•   blktrace/btt解释




                          2
IO子系统架构图


                     $stap -l
                     'ioblock.*'
                     ioblock.end
                     ioblock.request
                   $stap -l 'ioscheduler.*'
                   ioscheduler.elv_add_request
                   ioscheduler.elv_completed_request
blktrace   DM层     ioscheduler.elv_next_request




                                                  3
块层框图



buffered   mmap     direct io
io




                                4
思考



  IO子系统有几层?

各层的输入输出分别是什么?



                5
块层

probe ioblock.request
   –Fires whenever making a generic block I/O
    request.


probe ioblock.end
  –Fires whenever a block I/O transfer is complete.




                                                      6
DM 层




•LVM2(Linux Volume Manager 2 version)
•EVMS(Enterprise Volume Management System)      7
•dmraid(Device Mapper Raid Tool)
请求队列/电梯

probe ioscheduler.elv_add_request.kp
  - kprobe based probe to indicate that a
  request was added to the request queue

probe ioscheduler.elv_next_request
  –Fires when a request is retrieved from the request
    queue


probe ioscheduler.elv_completed_request
   –Fires when a request is completed
                                                        8
调度器参数微调
# cat /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq




文档参考:Documentation/block/deadline-iosched.txt
                                                9
思考




电梯算法的核心作用是什么?




                10
驱动程序

• 中断平衡
 – /proc/irq/IRQ/smp_affinity
• 软中断平衡
 – /sys/block/DEV/queue/rq_affinity




                                      11
块请求关键事件点
$perf list|grep “block:”或者
$trace-cmd list |grep 'block:*‘
$stap -l ‘kernel.trace(“block_*”)‘

block:block_rq_abort         block:block_bio_queue
block:block_rq_requeue       block:block_getrq
block:block_rq_complete      block:block_sleeprq
block:block_rq_insert        block:block_plug
block:block_rq_issue         block:block_unplug_timer
block:block_bio_bounce       block:block_unplug_io
block:block_bio_complete     block:block_split
block:block_bio_backmerge    block:block_remap
block:block_bio_frontmerge   block:block_rq_remap

                                                        12
Tracepoint解释

C -- complete A previously issued request has been completed.

D -- issued A request that previously resided on the block
   layer
           queue or in the i/o scheduler has been sent to the
   driver.

I -- inserted A request is being sent to the i/o scheduler for
   addi-tion to the internal queue and later service by the
   driver.

Q -- queued This notes intent to queue i/o at the given
  location.
                                                                13
B -- bounced The data pages attached to this bio are not
Tracepoint解释(续)

M -- back merge A previously inserted request exists that
  ends on the boundary of where this i/o begins, so the i/o
  scheduler can merge them together.

F -- front merge Same as the back merge, except this i/o ends
  where a previously inserted requests starts.

G -- get request To send any type of request to a block
   device, a struct request container must be allocated first.

S -- sleep No available request structures were available,
  so the
         issuer has to wait for one to be freed.
                                                              14
Tracepoint解释(续)

P -- plug When i/o is queued to a previously empty block
   device queue, Linux will plug the queue in anticipation of
   future ios being added before this data is needed.
U -- unplug Some request data already queued in the device,
   start sending requests to the driver.
T -- unplug due to timer If nobody requests the i/o that was
   queued after plugging the queue, Linux will automatically
   unplug it after a defined period has passed.
X -- split On raid or device mapper setups, an incoming
   i/o may
           straddle a device or internal zone and needs to be
   hopped      up into smaller pieces for service.
A -- remap For stacked devices, incoming i/o is remapped to
   device below it in the i/o stack.
                                                            15
思考




如何可视化IO请求生命期?



                16
IO行为观察




不觉得信息量太少吗?

             17
blktrace架构图




              18
blktrace可过滤事件

barrier: barrier attribute
complete: completed by driver
fs: requests
issue: issued to driver
pc: packet command events
queue: queue operations
read: read traces
requeue: requeue operations
sync: synchronous attribute
write: write traces
notify: trace messages
drv_data: additional driver specific trace

                                             19
btrace第一感




            20
blkiomon




           21
btt

#   blktrace /dev/sdb
#   blkparse -i sdb -d sdb.bin
#   blkrawverify sdb
#   btt -i sdb.bin -A




                                 22
btt: Life of an I/O

• Q2I – time it takes to process an I/O prior to it
  being inserted or merged onto a request queue
  – Includes split, and remap time
• I2D – time the I/O is “idle” on the request
  queue
• D2C – time the I/O is “active” in the driver and
  on the device
• Q2I + I2D + D2C = Q2C
  – Q2C: Total processing time of the I/O




                                                      23
btt解读

==================== All Devices ====================

            ALL           MIN           AVG           MAX           N
--------------- ------------- ------------- ------------- -----------

Q2Q              0.000007098   0.085323752    1.189534849         14
Q2G              0.000000685   0.000001737    0.000004757         12
G2I              0.000000272   0.000001724    0.000004240         12
Q2M              0.000000475   0.000001036    0.000001362          3
I2D              0.000002502   0.000244633    0.002238651         12
M2D              0.000004870   0.000065011    0.000178722          3
D2C              0.000055488   0.000145720    0.000219068         15
Q2C              0.000062048   0.000357405    0.002303758         15

                                                                    24
btt解读(续)

==================== Device Overhead ====================

       DEV   |       Q2G       G2I       Q2M       I2D       D2C
----------   | --------- --------- --------- --------- ---------
 ( 8, 16)    |   0.3889%   0.3859%   0.0580% 54.7575% 40.7717%
----------   | --------- --------- --------- --------- ---------
   Overall   |   0.3889%   0.3859%   0.0580% 54.7575% 40.7717%




                                                                   25
btt解读(续)

==================== Device Merge Information ====================

       DEV |       #Q       #D Ratio |     BLKmin BLKavg BLKmax        Total
---------- | -------- -------- ------- | -------- -------- -------- --------
 ( 8, 16) |        15       12     1.2 |        8       10       24      120




                                                                               26
btt解读(续)
==================== Device Q2Q Seek Information ====================

       DEV   |          NSEEKS            MEAN          MEDIAN | MODE
----------   | --------------- --------------- --------------- | ---------------
 ( 8, 16)    |              15     620978236.7               0 | 0(5)
----------   | --------------- --------------- --------------- | ---------------
   Overall   |          NSEEKS            MEAN          MEDIAN | MODE
   Average   |              15     620978236.7               0 | 0(5)

==================== Device D2D Seek Information ====================

       DEV   |          NSEEKS            MEAN          MEDIAN | MODE
----------   | --------------- --------------- --------------- | ---------------
 ( 8, 16)    |              12     776222795.9               0 | 0(2)
----------   | --------------- --------------- --------------- | ---------------
   Overall   |          NSEEKS            MEAN          MEDIAN | MODE
   Average   |              12     776222795.9               0 | 0(2)
                                                                               27
btt解读(续)

==================== Plug Information ====================

       DEV |    # Plugs # Timer Us | % Time Q Plugged
---------- | ---------- ---------- | ----------------
 ( 8, 16) |           5(         1) |  0.226614061%

       DEV   |    IOs/Unp   IOs/Unp(to)
----------   | ----------   ----------
 ( 8, 16)    |        0.8          1.0
----------   | ----------   ----------
   Overall   |    IOs/Unp   IOs/Unp(to)
   Average   |        0.8          1.0



                                                             28
btt解读(续)

================= Active Requests At Q Information ================


       DEV | Avg Reqs @ Q
---------- | -------------
 ( 8, 16) |            0.9




                                                                      29
思考




除了用户应用,
谁还在使用块层?


           30
页面回写机制

$stap –l ‘kernel.function("congestion_wait")‘

$perf list|grep "writeback:“

writeback:writeback_nothread
..
 writeback:writeback_nowork
 writeback:writeback_bdi_register
 writeback:writeback_bdi_unregister
 writeback:writeback_task_start
 writeback:writeback_task_stop
 writeback:wbc_writeback_start
 writeback:wbc_writeback_written
 writeback:wbc_writeback_wait
 writeback:wbc_balance_dirty_start
 writeback:wbc_balance_dirty_written
 writeback:wbc_balance_dirty_wait
 writeback:wbc_writepage                  31
参考材料

• blktrace相关:
  http://blog.yufeng.info/archives/tag/blktra
  ce
• systemtap相关:
  http://blog.yufeng.info/archives/tag/system
  tap




                                            32
提问时间




谢谢大家!


         33

More Related Content

What's hot

A Performance Characterization of Postgres on Different Storage Systems
A Performance Characterization of Postgres on Different Storage SystemsA Performance Characterization of Postgres on Different Storage Systems
A Performance Characterization of Postgres on Different Storage Systems
Dong Ye
 
Recent Developments in Donard
Recent Developments in DonardRecent Developments in Donard
Recent Developments in Donard
PMC-Sierra Inc.
 
Oracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open WorldOracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open World
Paul Marden
 
Bluestore
BluestoreBluestore
Bluestore
Patrick McGarry
 
Ceph Day New York 2014: Ceph, a physical perspective
Ceph Day New York 2014: Ceph, a physical perspective Ceph Day New York 2014: Ceph, a physical perspective
Ceph Day New York 2014: Ceph, a physical perspective
Ceph Community
 
Optimizing FUSE for Cloud Storage
Optimizing FUSE for Cloud StorageOptimizing FUSE for Cloud Storage
Optimizing FUSE for Cloud Storage
OpenVZ
 
ZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet Spots
Jervin Real
 
イマドキなNetwork/IO
イマドキなNetwork/IOイマドキなNetwork/IO
イマドキなNetwork/IOTakuya ASADA
 
Backup with Bareos and ZFS - by Christian Reiß
Backup with Bareos and ZFS - by Christian ReißBackup with Bareos and ZFS - by Christian Reiß
Backup with Bareos and ZFS - by Christian Reiß
NETWAYS
 
Webinar: What’s Your Path to NVMe?
Webinar: What’s Your Path to NVMe?Webinar: What’s Your Path to NVMe?
Webinar: What’s Your Path to NVMe?
Storage Switzerland
 
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
The Linux Foundation
 
The latest developments from OVHcloud’s bare metal ranges
The latest developments from OVHcloud’s bare metal rangesThe latest developments from OVHcloud’s bare metal ranges
The latest developments from OVHcloud’s bare metal ranges
OVHcloud
 
CephFS in Jewel: Stable at Last
CephFS in Jewel: Stable at LastCephFS in Jewel: Stable at Last
CephFS in Jewel: Stable at Last
Ceph Community
 
A Key-Value Store for Data Acquisition Systems
A Key-Value Store for Data Acquisition SystemsA Key-Value Store for Data Acquisition Systems
A Key-Value Store for Data Acquisition Systems
Intel® Software
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
Samsung Open Source Group
 
JetStor X Storage Products 2017! New HOT products!
JetStor X Storage Products 2017! New HOT products!JetStor X Storage Products 2017! New HOT products!
JetStor X Storage Products 2017! New HOT products!
Gene Leyzarovich
 
10 Things you need to know abut designing enterprise SSD
10 Things you need to know abut designing enterprise SSD10 Things you need to know abut designing enterprise SSD
10 Things you need to know abut designing enterprise SSDSimon Huang
 
JetStor ZFS DUAL NAS introduction
JetStor ZFS DUAL NAS introductionJetStor ZFS DUAL NAS introduction
JetStor ZFS DUAL NAS introduction
Gene Leyzarovich
 
Ceph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To EnterpriseCeph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To Enterprise
Alex Lau
 

What's hot (20)

A Performance Characterization of Postgres on Different Storage Systems
A Performance Characterization of Postgres on Different Storage SystemsA Performance Characterization of Postgres on Different Storage Systems
A Performance Characterization of Postgres on Different Storage Systems
 
Recent Developments in Donard
Recent Developments in DonardRecent Developments in Donard
Recent Developments in Donard
 
Oracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open WorldOracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open World
 
Bluestore
BluestoreBluestore
Bluestore
 
Ceph Day New York 2014: Ceph, a physical perspective
Ceph Day New York 2014: Ceph, a physical perspective Ceph Day New York 2014: Ceph, a physical perspective
Ceph Day New York 2014: Ceph, a physical perspective
 
Optimizing FUSE for Cloud Storage
Optimizing FUSE for Cloud StorageOptimizing FUSE for Cloud Storage
Optimizing FUSE for Cloud Storage
 
ZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet Spots
 
イマドキなNetwork/IO
イマドキなNetwork/IOイマドキなNetwork/IO
イマドキなNetwork/IO
 
Backup with Bareos and ZFS - by Christian Reiß
Backup with Bareos and ZFS - by Christian ReißBackup with Bareos and ZFS - by Christian Reiß
Backup with Bareos and ZFS - by Christian Reiß
 
Webinar: What’s Your Path to NVMe?
Webinar: What’s Your Path to NVMe?Webinar: What’s Your Path to NVMe?
Webinar: What’s Your Path to NVMe?
 
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...
 
The latest developments from OVHcloud’s bare metal ranges
The latest developments from OVHcloud’s bare metal rangesThe latest developments from OVHcloud’s bare metal ranges
The latest developments from OVHcloud’s bare metal ranges
 
CephFS in Jewel: Stable at Last
CephFS in Jewel: Stable at LastCephFS in Jewel: Stable at Last
CephFS in Jewel: Stable at Last
 
A Key-Value Store for Data Acquisition Systems
A Key-Value Store for Data Acquisition SystemsA Key-Value Store for Data Acquisition Systems
A Key-Value Store for Data Acquisition Systems
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 
JetStor X Storage Products 2017! New HOT products!
JetStor X Storage Products 2017! New HOT products!JetStor X Storage Products 2017! New HOT products!
JetStor X Storage Products 2017! New HOT products!
 
Kvm optimizations
Kvm optimizationsKvm optimizations
Kvm optimizations
 
10 Things you need to know abut designing enterprise SSD
10 Things you need to know abut designing enterprise SSD10 Things you need to know abut designing enterprise SSD
10 Things you need to know abut designing enterprise SSD
 
JetStor ZFS DUAL NAS introduction
JetStor ZFS DUAL NAS introductionJetStor ZFS DUAL NAS introduction
JetStor ZFS DUAL NAS introduction
 
Ceph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To EnterpriseCeph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To Enterprise
 

Viewers also liked

mnesia脑裂问题综述
mnesia脑裂问题综述mnesia脑裂问题综述
mnesia脑裂问题综述
Feng Yu
 
低成本和高性能MySQL云架构探索
低成本和高性能MySQL云架构探索低成本和高性能MySQL云架构探索
低成本和高性能MySQL云架构探索Feng Yu
 
了解应用服务器
了解应用服务器了解应用服务器
了解应用服务器
Feng Yu
 
Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言Feng Yu
 
Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告Feng Yu
 
利用新硬件提升数据库性能
利用新硬件提升数据库性能利用新硬件提升数据库性能
利用新硬件提升数据库性能
Feng Yu
 
了解内存
了解内存了解内存
了解内存Feng Yu
 
MySQL和IO(上)
MySQL和IO(上)MySQL和IO(上)
MySQL和IO(上)Feng Yu
 
Flash存储设备在淘宝的应用实践
Flash存储设备在淘宝的应用实践Flash存储设备在淘宝的应用实践
Flash存储设备在淘宝的应用实践
Feng Yu
 
我为什么要选择RabbitMQ
我为什么要选择RabbitMQ我为什么要选择RabbitMQ
我为什么要选择RabbitMQ
Feng Yu
 
了解集群
了解集群了解集群
了解集群
Feng Yu
 
高性能集群服务器(Erlang解决方案)
高性能集群服务器(Erlang解决方案)高性能集群服务器(Erlang解决方案)
高性能集群服务器(Erlang解决方案)
Feng Yu
 

Viewers also liked (12)

mnesia脑裂问题综述
mnesia脑裂问题综述mnesia脑裂问题综述
mnesia脑裂问题综述
 
低成本和高性能MySQL云架构探索
低成本和高性能MySQL云架构探索低成本和高性能MySQL云架构探索
低成本和高性能MySQL云架构探索
 
了解应用服务器
了解应用服务器了解应用服务器
了解应用服务器
 
Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言
 
Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告Rethink db&tokudb调研测试报告
Rethink db&tokudb调研测试报告
 
利用新硬件提升数据库性能
利用新硬件提升数据库性能利用新硬件提升数据库性能
利用新硬件提升数据库性能
 
了解内存
了解内存了解内存
了解内存
 
MySQL和IO(上)
MySQL和IO(上)MySQL和IO(上)
MySQL和IO(上)
 
Flash存储设备在淘宝的应用实践
Flash存储设备在淘宝的应用实践Flash存储设备在淘宝的应用实践
Flash存储设备在淘宝的应用实践
 
我为什么要选择RabbitMQ
我为什么要选择RabbitMQ我为什么要选择RabbitMQ
我为什么要选择RabbitMQ
 
了解集群
了解集群了解集群
了解集群
 
高性能集群服务器(Erlang解决方案)
高性能集群服务器(Erlang解决方案)高性能集群服务器(Erlang解决方案)
高性能集群服务器(Erlang解决方案)
 

Similar to 了解IO协议栈

BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdfBRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
aaajjj4
 
PoC Oracle Exadata - Retour d'expérience
PoC Oracle Exadata - Retour d'expériencePoC Oracle Exadata - Retour d'expérience
PoC Oracle Exadata - Retour d'expérience
Swiss Data Forum Swiss Data Forum
 
Writing efficient sql
Writing efficient sqlWriting efficient sql
Writing efficient sqlj9soto
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
NETWAYS
 
OSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015: Linux Performance Profiling and Monitoring by Werner FischerOSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
NETWAYS
 
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner FischerOSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
NETWAYS
 
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
OSDC 2015: Georg Schönberger | Linux Performance Profiling and MonitoringOSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
NETWAYS
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
Georg Schönberger
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part III
Alkin Tezuysal
 
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
aaajjj4
 
Cisco: Care and Feeding of Smart Licensing
Cisco: Care and Feeding of Smart LicensingCisco: Care and Feeding of Smart Licensing
Cisco: Care and Feeding of Smart Licensing
daxtindavon
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
Aleem Shariff
 
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Cuneyt Goksu
 
2010 03 papi_indiana
2010 03 papi_indiana2010 03 papi_indiana
2010 03 papi_indianaPTIHPA
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
Brendan Gregg
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
Nullbyte Security Conference
 

Similar to 了解IO协议栈 (20)

BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdfBRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
BRKRST-3066 - Troubleshooting Nexus 7000 (2013 Melbourne) - 2 Hours.pdf
 
PoC Oracle Exadata - Retour d'expérience
PoC Oracle Exadata - Retour d'expériencePoC Oracle Exadata - Retour d'expérience
PoC Oracle Exadata - Retour d'expérience
 
Writing efficient sql
Writing efficient sqlWriting efficient sql
Writing efficient sql
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
 
OSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015: Linux Performance Profiling and Monitoring by Werner FischerOSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015: Linux Performance Profiling and Monitoring by Werner Fischer
 
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner FischerOSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
OSMC 2015 | Linux Performance Profiling and Monitoring by Werner Fischer
 
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
OSDC 2015: Georg Schönberger | Linux Performance Profiling and MonitoringOSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part III
 
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
 
Cisco: Care and Feeding of Smart Licensing
Cisco: Care and Feeding of Smart LicensingCisco: Care and Feeding of Smart Licensing
Cisco: Care and Feeding of Smart Licensing
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
 
2010 03 papi_indiana
2010 03 papi_indiana2010 03 papi_indiana
2010 03 papi_indiana
 
Oracle 11g caracteristicas poco documentadas 3 en 1
Oracle 11g caracteristicas poco documentadas 3 en 1Oracle 11g caracteristicas poco documentadas 3 en 1
Oracle 11g caracteristicas poco documentadas 3 en 1
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
 

More from Feng Yu

Erlang开发实践
Erlang开发实践Erlang开发实践
Erlang开发实践
Feng Yu
 
MySQL和IO(下)
MySQL和IO(下)MySQL和IO(下)
MySQL和IO(下)Feng Yu
 
SSD在淘宝的应用实践
SSD在淘宝的应用实践SSD在淘宝的应用实践
SSD在淘宝的应用实践
Feng Yu
 
淘宝商品库MySQL优化实践
淘宝商品库MySQL优化实践淘宝商品库MySQL优化实践
淘宝商品库MySQL优化实践Feng Yu
 
开源混合存储方案(Flashcache)
开源混合存储方案(Flashcache)开源混合存储方案(Flashcache)
开源混合存储方案(Flashcache)
Feng Yu
 
Erlang low cost_clound_computing
Erlang low cost_clound_computingErlang low cost_clound_computing
Erlang low cost_clound_computing
Feng Yu
 
Systemtap
SystemtapSystemtap
SystemtapFeng Yu
 
Oprofile linux
Oprofile linuxOprofile linux
Oprofile linuxFeng Yu
 
C1000K高性能服务器构建技术
C1000K高性能服务器构建技术C1000K高性能服务器构建技术
C1000K高性能服务器构建技术
Feng Yu
 
Erlang全接触
Erlang全接触Erlang全接触
Erlang全接触Feng Yu
 
Tsung 压力测试工具
Tsung 压力测试工具Tsung 压力测试工具
Tsung 压力测试工具
Feng Yu
 
Inside Erlang Vm II
Inside Erlang Vm IIInside Erlang Vm II
Inside Erlang Vm II
Feng Yu
 
Go Lang
Go LangGo Lang
Go Lang
Feng Yu
 

More from Feng Yu (14)

Erlang开发实践
Erlang开发实践Erlang开发实践
Erlang开发实践
 
MySQL和IO(下)
MySQL和IO(下)MySQL和IO(下)
MySQL和IO(下)
 
SSD在淘宝的应用实践
SSD在淘宝的应用实践SSD在淘宝的应用实践
SSD在淘宝的应用实践
 
淘宝商品库MySQL优化实践
淘宝商品库MySQL优化实践淘宝商品库MySQL优化实践
淘宝商品库MySQL优化实践
 
开源混合存储方案(Flashcache)
开源混合存储方案(Flashcache)开源混合存储方案(Flashcache)
开源混合存储方案(Flashcache)
 
Erlang low cost_clound_computing
Erlang low cost_clound_computingErlang low cost_clound_computing
Erlang low cost_clound_computing
 
Systemtap
SystemtapSystemtap
Systemtap
 
Oprofile linux
Oprofile linuxOprofile linux
Oprofile linux
 
Go
GoGo
Go
 
C1000K高性能服务器构建技术
C1000K高性能服务器构建技术C1000K高性能服务器构建技术
C1000K高性能服务器构建技术
 
Erlang全接触
Erlang全接触Erlang全接触
Erlang全接触
 
Tsung 压力测试工具
Tsung 压力测试工具Tsung 压力测试工具
Tsung 压力测试工具
 
Inside Erlang Vm II
Inside Erlang Vm IIInside Erlang Vm II
Inside Erlang Vm II
 
Go Lang
Go LangGo Lang
Go Lang
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

了解IO协议栈

  • 2. 提纲 • IO子系统架构图 • IO子系统各层分解 • IO请求事件跟踪点 • blktrace/btt解释 2
  • 3. IO子系统架构图 $stap -l 'ioblock.*' ioblock.end ioblock.request $stap -l 'ioscheduler.*' ioscheduler.elv_add_request ioscheduler.elv_completed_request blktrace DM层 ioscheduler.elv_next_request 3
  • 4. 块层框图 buffered mmap direct io io 4
  • 6. 块层 probe ioblock.request –Fires whenever making a generic block I/O request. probe ioblock.end –Fires whenever a block I/O transfer is complete. 6
  • 7. DM 层 •LVM2(Linux Volume Manager 2 version) •EVMS(Enterprise Volume Management System) 7 •dmraid(Device Mapper Raid Tool)
  • 8. 请求队列/电梯 probe ioscheduler.elv_add_request.kp - kprobe based probe to indicate that a request was added to the request queue probe ioscheduler.elv_next_request –Fires when a request is retrieved from the request queue probe ioscheduler.elv_completed_request –Fires when a request is completed 8
  • 9. 调度器参数微调 # cat /sys/block/sda/queue/scheduler noop anticipatory [deadline] cfq 文档参考:Documentation/block/deadline-iosched.txt 9
  • 11. 驱动程序 • 中断平衡 – /proc/irq/IRQ/smp_affinity • 软中断平衡 – /sys/block/DEV/queue/rq_affinity 11
  • 12. 块请求关键事件点 $perf list|grep “block:”或者 $trace-cmd list |grep 'block:*‘ $stap -l ‘kernel.trace(“block_*”)‘ block:block_rq_abort block:block_bio_queue block:block_rq_requeue block:block_getrq block:block_rq_complete block:block_sleeprq block:block_rq_insert block:block_plug block:block_rq_issue block:block_unplug_timer block:block_bio_bounce block:block_unplug_io block:block_bio_complete block:block_split block:block_bio_backmerge block:block_remap block:block_bio_frontmerge block:block_rq_remap 12
  • 13. Tracepoint解释 C -- complete A previously issued request has been completed. D -- issued A request that previously resided on the block layer queue or in the i/o scheduler has been sent to the driver. I -- inserted A request is being sent to the i/o scheduler for addi-tion to the internal queue and later service by the driver. Q -- queued This notes intent to queue i/o at the given location. 13 B -- bounced The data pages attached to this bio are not
  • 14. Tracepoint解释(续) M -- back merge A previously inserted request exists that ends on the boundary of where this i/o begins, so the i/o scheduler can merge them together. F -- front merge Same as the back merge, except this i/o ends where a previously inserted requests starts. G -- get request To send any type of request to a block device, a struct request container must be allocated first. S -- sleep No available request structures were available, so the issuer has to wait for one to be freed. 14
  • 15. Tracepoint解释(续) P -- plug When i/o is queued to a previously empty block device queue, Linux will plug the queue in anticipation of future ios being added before this data is needed. U -- unplug Some request data already queued in the device, start sending requests to the driver. T -- unplug due to timer If nobody requests the i/o that was queued after plugging the queue, Linux will automatically unplug it after a defined period has passed. X -- split On raid or device mapper setups, an incoming i/o may straddle a device or internal zone and needs to be hopped up into smaller pieces for service. A -- remap For stacked devices, incoming i/o is remapped to device below it in the i/o stack. 15
  • 19. blktrace可过滤事件 barrier: barrier attribute complete: completed by driver fs: requests issue: issued to driver pc: packet command events queue: queue operations read: read traces requeue: requeue operations sync: synchronous attribute write: write traces notify: trace messages drv_data: additional driver specific trace 19
  • 21. blkiomon 21
  • 22. btt # blktrace /dev/sdb # blkparse -i sdb -d sdb.bin # blkrawverify sdb # btt -i sdb.bin -A 22
  • 23. btt: Life of an I/O • Q2I – time it takes to process an I/O prior to it being inserted or merged onto a request queue – Includes split, and remap time • I2D – time the I/O is “idle” on the request queue • D2C – time the I/O is “active” in the driver and on the device • Q2I + I2D + D2C = Q2C – Q2C: Total processing time of the I/O 23
  • 24. btt解读 ==================== All Devices ==================== ALL MIN AVG MAX N --------------- ------------- ------------- ------------- ----------- Q2Q 0.000007098 0.085323752 1.189534849 14 Q2G 0.000000685 0.000001737 0.000004757 12 G2I 0.000000272 0.000001724 0.000004240 12 Q2M 0.000000475 0.000001036 0.000001362 3 I2D 0.000002502 0.000244633 0.002238651 12 M2D 0.000004870 0.000065011 0.000178722 3 D2C 0.000055488 0.000145720 0.000219068 15 Q2C 0.000062048 0.000357405 0.002303758 15 24
  • 25. btt解读(续) ==================== Device Overhead ==================== DEV | Q2G G2I Q2M I2D D2C ---------- | --------- --------- --------- --------- --------- ( 8, 16) | 0.3889% 0.3859% 0.0580% 54.7575% 40.7717% ---------- | --------- --------- --------- --------- --------- Overall | 0.3889% 0.3859% 0.0580% 54.7575% 40.7717% 25
  • 26. btt解读(续) ==================== Device Merge Information ==================== DEV | #Q #D Ratio | BLKmin BLKavg BLKmax Total ---------- | -------- -------- ------- | -------- -------- -------- -------- ( 8, 16) | 15 12 1.2 | 8 10 24 120 26
  • 27. btt解读(续) ==================== Device Q2Q Seek Information ==================== DEV | NSEEKS MEAN MEDIAN | MODE ---------- | --------------- --------------- --------------- | --------------- ( 8, 16) | 15 620978236.7 0 | 0(5) ---------- | --------------- --------------- --------------- | --------------- Overall | NSEEKS MEAN MEDIAN | MODE Average | 15 620978236.7 0 | 0(5) ==================== Device D2D Seek Information ==================== DEV | NSEEKS MEAN MEDIAN | MODE ---------- | --------------- --------------- --------------- | --------------- ( 8, 16) | 12 776222795.9 0 | 0(2) ---------- | --------------- --------------- --------------- | --------------- Overall | NSEEKS MEAN MEDIAN | MODE Average | 12 776222795.9 0 | 0(2) 27
  • 28. btt解读(续) ==================== Plug Information ==================== DEV | # Plugs # Timer Us | % Time Q Plugged ---------- | ---------- ---------- | ---------------- ( 8, 16) | 5( 1) | 0.226614061% DEV | IOs/Unp IOs/Unp(to) ---------- | ---------- ---------- ( 8, 16) | 0.8 1.0 ---------- | ---------- ---------- Overall | IOs/Unp IOs/Unp(to) Average | 0.8 1.0 28
  • 29. btt解读(续) ================= Active Requests At Q Information ================ DEV | Avg Reqs @ Q ---------- | ------------- ( 8, 16) | 0.9 29
  • 31. 页面回写机制 $stap –l ‘kernel.function("congestion_wait")‘ $perf list|grep "writeback:“ writeback:writeback_nothread .. writeback:writeback_nowork writeback:writeback_bdi_register writeback:writeback_bdi_unregister writeback:writeback_task_start writeback:writeback_task_stop writeback:wbc_writeback_start writeback:wbc_writeback_written writeback:wbc_writeback_wait writeback:wbc_balance_dirty_start writeback:wbc_balance_dirty_written writeback:wbc_balance_dirty_wait writeback:wbc_writepage 31
  • 32. 参考材料 • blktrace相关: http://blog.yufeng.info/archives/tag/blktra ce • systemtap相关: http://blog.yufeng.info/archives/tag/system tap 32