linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] block: Fix not tracing all device plug-operation.
@ 2012-08-10 11:46 Jianpeng Ma
  2012-08-10 13:09 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Jianpeng Ma @ 2012-08-10 11:46 UTC (permalink / raw)
  To: axboe; +Cc: shli, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1161 bytes --]

If process handled two or more devices,there will not be trace some
devices plug-operation.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 block/blk-core.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 7a3abc6..034f186 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -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);
-- 
1.7.9.5
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/3] block: Fix not tracing all device plug-operation.
  2012-08-10 11:46 [PATCH 2/3] block: Fix not tracing all device plug-operation Jianpeng Ma
@ 2012-08-10 13:09 ` Jens Axboe
  2012-09-15  1:35   ` Jianpeng Ma
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2012-08-10 13:09 UTC (permalink / raw)
  To: Jianpeng Ma; +Cc: shli, linux-kernel

On 08/10/2012 01:46 PM, Jianpeng Ma wrote:
> If process handled two or more devices,there will not be trace some
> devices plug-operation.
> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  block/blk-core.c |   16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 7a3abc6..034f186 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -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;

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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [PATCH 2/3] block: Fix not tracing all device plug-operation.
  2012-08-10 13:09 ` Jens Axboe
@ 2012-09-15  1:35   ` Jianpeng Ma
  0 siblings, 0 replies; 3+ messages in thread
From: Jianpeng Ma @ 2012-09-15  1:35 UTC (permalink / raw)
  To: Jens Axboe; +Cc: shli, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1527 bytes --]

On 2012-08-10 21:09 Jens Axboe <jaxboe@fusionio.com> Wrote:
>On 08/10/2012 01:46 PM, Jianpeng Ma wrote:
>> If process handled two or more devices,there will not be trace some
>> devices plug-operation.
>> 
>> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
>> ---
>>  block/blk-core.c |   16 +++++++++++++++-
>>  1 file changed, 15 insertions(+), 1 deletion(-)
>> 
>> diff --git a/block/blk-core.c b/block/blk-core.c
>> index 7a3abc6..034f186 100644
>> --- a/block/blk-core.c
>> +++ b/block/blk-core.c
>> @@ -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;
>
>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.
>
>-- 
>Jens Axboe
>
Hi all:
	How about those patches? Ok or wrong? 
Thanks!ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-15  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 11:46 [PATCH 2/3] block: Fix not tracing all device plug-operation Jianpeng Ma
2012-08-10 13:09 ` Jens Axboe
2012-09-15  1:35   ` Jianpeng Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).