]> Pileus Git - ~andy/linux/commitdiff
block: readd plug trace event
authorJens Axboe <jaxboe@fusionio.com>
Tue, 12 Apr 2011 08:28:28 +0000 (10:28 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 12 Apr 2011 08:28:28 +0000 (10:28 +0200)
This was removed with the queue plug state. But we can easily readd
by checking if this is the first request going to this queue. It's
good information to have when tracing to see how effective the
plugging is.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/blk-core.c

index 76850fc9cf23b86d29ed84e0282a88acef0c2440..52e756c526be738501967970808a58cf71f4a819 100644 (file)
@@ -1311,7 +1311,15 @@ get_rq:
 
        plug = current->plug;
        if (plug) {
-               if (!plug->should_sort && !list_empty(&plug->list)) {
+               /*
+                * If this is the first request added after a plug, fire
+                * of a plug trace. If others have been added before, check
+                * if we have multiple devices in this plug. If so, make a
+                * note to sort the list before dispatch.
+                */
+               if (list_empty(&plug->list))
+                       trace_block_plug(q);
+               else if (!plug->should_sort) {
                        struct request *__rq;
 
                        __rq = list_entry_rq(plug->list.prev);