From: Jens Axboe <jaxboe@fusionio.com>
To: Jianpeng Ma <majianpeng@gmail.com>
Cc: shli <shli@kernel.org>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] block: Fix not tracing all device plug-operation.
Date: Fri, 10 Aug 2012 15:09:30 +0200 [thread overview]
Message-ID: <5025080A.1040001@fusionio.com> (raw)
In-Reply-To: <201208101945571256852@gmail.com>
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
next prev parent reply other threads:[~2012-08-10 13:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2012-09-15 1:35 ` Jianpeng Ma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5025080A.1040001@fusionio.com \
--to=jaxboe@fusionio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=majianpeng@gmail.com \
--cc=shli@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).