block: Fix not tracing all device plug-operation.
PATCH 2/3 block: Fix not tracing all device plug-operation.
If process handled two or more devices,there will not be trace some devices plug-operation.
--- block/blk-core.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
block/blk-core.c +15 -1
@@ -1521,11 +1521,25 @@ get_rq:struct request *__rq; __rq =list_entry_rq (plug->list.prev); -if (__rq->q != q) +if (__rq->q != q) { plug->should_sort =1 ; +trace_block_plug (q); + } + }else { +struct request *__rq; +list_for_each_entry_reverse (__rq, &plug->list, + queuelist) { +if (__rq->q == q) { +list_add_tail (&req->queuelist, + &__rq->queuelist); + goto stat_acct; + } + } +trace_block_plug (q); } }list_add_tail (&req->queuelist, &plug->list); +stat_acct:drive_stat_acct (req,1 ); }else {spin_lock_irq (q->queue_lock);
Signature · 2 lines
1.7.9.5
�翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m����鹅�⒏?朓�Quoted 19 lines · Jianpeng Ma
If process handled two or more devices,there will not be trace some devices plug-operation.
Signed-off-by Jianpeng Ma <[email protected]>--- block/blk-core.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)block/blk-core.c +1
-1@@ -1521,11 +1521,25 @@ get_rq:struct request *__rq; __rq =list_entry_rq (plug->list.prev); -if (__rq->q != q) +if (__rq->q != q) { plug->should_sort =1 ;
block/blk-core.c get_rq: · line 1535
Quoted 10 lines
block/blk-core.c +10
-0+trace_block_plug (q); + } + }else { +struct request *__rq; +list_for_each_entry_reverse (__rq, &plug->list, + queuelist) { +if (__rq->q == q) { +list_add_tail (&req->queuelist, + &__rq->queuelist); + goto stat_acct;
Did you verify this? It doesn't look right to me. You browse the list in reverse, which means __rq is the first one that has a matching q. Then you add the new req IN FRONT of that. You would want list_add() here instead, adding it as the last member of that q string, not in the middle.
Signature · 1 line
Jens Axboe
On 2012-08-10 21:09 Jens Axboe <[email protected]> Wrote:
Quoted 28 lines · Jianpeng Ma
Quoted 27 lines
If process handled two or more devices,there will not be trace some devices plug-operation.
Signed-off-by Jianpeng Ma <[email protected]>--- block/blk-core.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)block/blk-core.c +9
-1@@ -1521,11 +1521,25 @@ get_rq:struct request *__rq; __rq =list_entry_rq (plug->list.prev); -if (__rq->q != q) +if (__rq->q != q) { plug->should_sort =1 ; +trace_block_plug (q); + } + }else { +struct request *__rq; +list_for_each_entry_reverse (__rq, &plug->list, + queuelist) { +if (__rq->q == q) { + list_add_tail(&req->queuelist,
Quoted 12 lines
block/blk-core.c get_rq: · line 1535
Quoted 2 lines
block/blk-core.c +2
-0+ &__rq->queuelist); + goto stat_acct;Did you verify this? It doesn't look right to me. You browse the list in reverse, which means
__rqis the first one that has a matching q. Then you add the new req IN FRONT of that. You would wantlist_add()here instead, adding it as the last member of that q string, not in the middle.Signature · 1 line
Jens Axboe
Hi all:
How about those patches? Ok or wrong?
Thanks!�翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m����鹅�⒏?朓�