aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-16 13:33:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-16 13:33:41 -0400
commitd733ed6c34be3aef0517a04e4103eed6b369ec50 (patch)
treeb49723304c48c2f877b9cb284a4b39361934c670 /kernel
parent08150c533c57981054324b9e87dbf686006d890f (diff)
parent49cac01e1fa74174d72adb0e872504a7fefd7c01 (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: block: make unplug timer trace event correspond to the schedule() unplug block: let io_schedule() flush the plug inline
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/trace/blktrace.c18
2 files changed, 13 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index a187c3fe027b..312f8b95c2d4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4118,7 +4118,7 @@ need_resched:
4118 */ 4118 */
4119 if (blk_needs_flush_plug(prev)) { 4119 if (blk_needs_flush_plug(prev)) {
4120 raw_spin_unlock(&rq->lock); 4120 raw_spin_unlock(&rq->lock);
4121 blk_flush_plug(prev); 4121 blk_schedule_flush_plug(prev);
4122 raw_spin_lock(&rq->lock); 4122 raw_spin_lock(&rq->lock);
4123 } 4123 }
4124 } 4124 }
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 3e3970d53d14..6957aa298dfa 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -850,16 +850,21 @@ static void blk_add_trace_plug(void *ignore, struct request_queue *q)
850 __blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL); 850 __blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL);
851} 851}
852 852
853static void blk_add_trace_unplug_io(void *ignore, struct request_queue *q, 853static void blk_add_trace_unplug(void *ignore, struct request_queue *q,
854 unsigned int depth) 854 unsigned int depth, bool explicit)
855{ 855{
856 struct blk_trace *bt = q->blk_trace; 856 struct blk_trace *bt = q->blk_trace;
857 857
858 if (bt) { 858 if (bt) {
859 __be64 rpdu = cpu_to_be64(depth); 859 __be64 rpdu = cpu_to_be64(depth);
860 u32 what;
860 861
861 __blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_IO, 0, 862 if (explicit)
862 sizeof(rpdu), &rpdu); 863 what = BLK_TA_UNPLUG_IO;
864 else
865 what = BLK_TA_UNPLUG_TIMER;
866
867 __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
863 } 868 }
864} 869}
865 870
@@ -1002,7 +1007,7 @@ static void blk_register_tracepoints(void)
1002 WARN_ON(ret); 1007 WARN_ON(ret);
1003 ret = register_trace_block_plug(blk_add_trace_plug, NULL); 1008 ret = register_trace_block_plug(blk_add_trace_plug, NULL);
1004 WARN_ON(ret); 1009 WARN_ON(ret);
1005 ret = register_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); 1010 ret = register_trace_block_unplug(blk_add_trace_unplug, NULL);
1006 WARN_ON(ret); 1011 WARN_ON(ret);
1007 ret = register_trace_block_split(blk_add_trace_split, NULL); 1012 ret = register_trace_block_split(blk_add_trace_split, NULL);
1008 WARN_ON(ret); 1013 WARN_ON(ret);
@@ -1017,7 +1022,7 @@ static void blk_unregister_tracepoints(void)
1017 unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); 1022 unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL);
1018 unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL); 1023 unregister_trace_block_bio_remap(blk_add_trace_bio_remap, NULL);
1019 unregister_trace_block_split(blk_add_trace_split, NULL); 1024 unregister_trace_block_split(blk_add_trace_split, NULL);
1020 unregister_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); 1025 unregister_trace_block_unplug(blk_add_trace_unplug, NULL);
1021 unregister_trace_block_plug(blk_add_trace_plug, NULL); 1026 unregister_trace_block_plug(blk_add_trace_plug, NULL);
1022 unregister_trace_block_sleeprq(blk_add_trace_sleeprq, NULL); 1027 unregister_trace_block_sleeprq(blk_add_trace_sleeprq, NULL);
1023 unregister_trace_block_getrq(blk_add_trace_getrq, NULL); 1028 unregister_trace_block_getrq(blk_add_trace_getrq, NULL);
@@ -1332,6 +1337,7 @@ static const struct {
1332 [__BLK_TA_COMPLETE] = {{ "C", "complete" }, blk_log_with_error }, 1337 [__BLK_TA_COMPLETE] = {{ "C", "complete" }, blk_log_with_error },
1333 [__BLK_TA_PLUG] = {{ "P", "plug" }, blk_log_plug }, 1338 [__BLK_TA_PLUG] = {{ "P", "plug" }, blk_log_plug },
1334 [__BLK_TA_UNPLUG_IO] = {{ "U", "unplug_io" }, blk_log_unplug }, 1339 [__BLK_TA_UNPLUG_IO] = {{ "U", "unplug_io" }, blk_log_unplug },
1340 [__BLK_TA_UNPLUG_TIMER] = {{ "UT", "unplug_timer" }, blk_log_unplug },
1335 [__BLK_TA_INSERT] = {{ "I", "insert" }, blk_log_generic }, 1341 [__BLK_TA_INSERT] = {{ "I", "insert" }, blk_log_generic },
1336 [__BLK_TA_SPLIT] = {{ "X", "split" }, blk_log_split }, 1342 [__BLK_TA_SPLIT] = {{ "X", "split" }, blk_log_split },
1337 [__BLK_TA_BOUNCE] = {{ "B", "bounce" }, blk_log_generic }, 1343 [__BLK_TA_BOUNCE] = {{ "B", "bounce" }, blk_log_generic },