1. Tools
Kprobe, used to catch some real-time data
Iostate-kx 1/dev/*
Blktrace-d/dev/dm-33-o-|blkparse-i-o blkparse.out
Http://blog.chinaunix.net/uid-24774106-id-4096470.html
2. Through trace discovery, sometimes the bio out of the queue is done by the KBLOCKD process, and kblockd every 3ms execution (blk_unplug_timeout), which is the reason for poor performance.
But sometimes, it is in the current context out of the queue, not through the IO scheduling subsystem (should be called __generic_unplug_device).
3. Blk_queue_make_request (), this function inside set q->unplug_delay = Msecs_to_jiffies (3), 3ms wake Kblockd once.
Block devices under the device mapped framework:
Dm_request () "Bio's entrance"
--Blk_queue_bio (q, bio)
-Blk_queue_bio
In the Blk_queue_bio function, if bio sets the Bio_rw_unplug bit, the const bool unplug = bio_rw_flagged (bio, bio_rw_unplug);
The __generic_unplug_device () is called, that is, the bio can be forwarded in the current context.
Block Device Performance Tuning