Skip to contentSkip to conversation

block: trace all devices plug operation.

PATCH Applied majianpeng 2 participants 3 messages Aug 21, 2013 – Sep 16, 2013 Block layer

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 block: trace all devices plug operation.

In func blk_queue_bio, if list of plug is empty,it will call blk_trace_plug.
If process deal with a single device,it't ok.But if process deal with multi devices,it only trace the first device.
Using request_count to judge, it can soleve this problem.

In addition, i modify the comment.

---
 block/blk-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
block/blk-core.c +2 -4
index 93a18d1..91037f7 100644
@@ -1549,11 +1549,9 @@ get_rq:
 	if (plug) {
 		/*
 		 * 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.
+		 * of a plug trace.
 		 */
-		if (list_empty(&plug->list))
+		if (!request_count)
 			trace_block_plug(q);
 		else {
 			if (request_count >= BLK_MAX_REQUEST_COUNT) {
Signature · 2 lines
1.8.3
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿÃÿ¶ìÿ¢¸?–I¥
author
#1 lore raw

Hi axboe:
How about this patch?

Thanks!
Jianpeng Ma

Quoted 33 lines

In func blk_queue_bio, if list of plug is empty,it will call blk_trace_plug.
If process deal with a single device,it't ok.But if process deal with multi devices,it only trace the first device.
Using request_count to judge, it can soleve this problem.

In addition, i modify the comment.

---
block/blk-core.c | 6 ++----

1 file changed, 2 insertions(+), 4 deletions(-)
block/blk-core.c +2 -4
index 93a18d1..91037f7 100644
@@ -1549,11 +1549,9 @@ get_rq:
 	if (plug) {
 		/*
 		 * 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.
+		 * of a plug trace.
 		 */
-		if (list_empty(&plug->list))
+		if (!request_count)
 			trace_block_plug(q);
 		else {
 			if (request_count >= BLK_MAX_REQUEST_COUNT) {
Signature · 1 line
1.8.3�翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m����鹅�⒏?朓�
maintainer Applied
#2 lore raw
Quoted 2 lines · majianpeng

Hi axboe:
How about this patch?

Applied.

Signature · 1 line
Jens Axboe