All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Peter Geis <pgwipeout@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [Regression] Linux-Next Merge 25Jul2018 breaks mmc on Tegra.
Date: Wed, 1 Aug 2018 00:25:25 +0800	[thread overview]
Message-ID: <20180731162518.GA18025@ming.t460p> (raw)
In-Reply-To: <da1eeaf2-e682-c0ed-d8fb-245770e0151c@gmail.com>

Hi Peter,

On Tue, Jul 31, 2018 at 08:47:45AM -0400, Peter Geis wrote:
> Good Morning,
> 
> On 07/30/2018 09:38 PM, Ming Lei wrote:
> > Hi Peter,
> > 
> > Thanks for collecting the log.
> > 
> > On Mon, Jul 30, 2018 at 02:55:42PM -0400, Peter Geis wrote:
> > > 
> > > 
> > > On 07/28/2018 09:37 AM, Ming Lei wrote:
> > 
> > ...
> > 
> > > [   10.887209] systemd--112     0.n.1 2411122us : blk_mq_make_request: make
> > > rq -1
> > > [   10.890274] kworker/-98      0...1 2411506us : blk_mq_free_request:
> > > complete: rq -1
> > > [   10.893313] systemd--107     0...1 2412025us : blk_mq_make_request: make
> > > rq -1
> > > [   10.896354] systemd--107     0.... 2412323us : mmc_mq_queue_rq: queue rq
> > > -1, 0
> > > [   10.899388] systemd--107     0.... 2412327us :
> > > blk_mq_try_issue_list_directly: issue direct: rq -1, ret 0
> > > [   10.902463] (direxec-111     1...1 2413829us : blk_mq_make_request: make
> > > rq -1
> > > [   10.905513] systemd--114     1...1 2415159us : blk_mq_make_request: make
> > > rq -1
> > 
> > Above is the most interesting part in the log. MMC sets hw queue depth
> > as 1, and you are using none scheduler, that means the max number of
> > in-flight requests should be one, but the above log shows that there may
> > be 3 in-flight requests.
> 
> That's odd, I have CFQ set as the default, is something changing this during
> boot?
> CONFIG_CFQ_GROUP_IOSCHED=y
> CONFIG_DEFAULT_IOSCHED="cfq"

No, now mmc has been converted to blk-mq, and the default mq io sched
should have been mq-deadline for mmc, but not sure why it is none in
your case.

> 
> > 
> > That seems really weird, but it shouldn't be related with my two patches,
> > which won't change the tag allocation behaviour at all. However, what matters
> > may be that the patch speeds up the request dispatch. Maybe one bug
> > in lib/sbitmap.c block/blk-mq-tag.c.
> > 
> > Unfortunately rq->tag wasn't shown in the log because I forget to dump
> > it in the debug patch, so could you apply the following new debug patch and
> > provide us the log again? BTW, please attach the ftrace log in the reply
> > mail directly, then it may be parsed/looked easily.
> 
> I have resynced to the latest linux-next and applied your new patch.
> The log is attached.
> 
> Of note, it took several boots this time before it would progress to where I
> could grab the log.
> Instead it was blocking the moment RW was requested.
> Also of note, it seems only the emmc is affected, the SD card (mmcblk2) does
> not trigger any errors.

>From the log you captured, seems there are three requests(33, 34, 60) blocked,
which should have been inside mmc, but still need to confirm, could you apply the
following one-line patch against the last debug patch and collect the log again?

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index d35f265cd5e0..ac2ffc5a8ed4 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -321,6 +321,8 @@ static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
                                   !host->hold_retune;
        }

+       if (blk_queue_debug(q))
+               trace_printk("mmc before issue rq %d %d\n", req->internal_tag, req->tag);
        blk_mq_start_request(req);

        issued = mmc_blk_mq_issue_rq(mq, req);


Also see comments in mmc_mq_queue_rq():

	/*
	 * We use BLK_MQ_F_BLOCKING and have only 1 hardware queue, which means requests
	 * will not be dispatched in parallel.
	 */

which isn't correct, given blk-mq has multiple sw queue and mmc sets the queue depth
as > 1, and requests may be dispatched to the unique hw queue in parallel.

Adrian, Ulf Hansson and anyone, could you take a look at the warning of WARN_ON(host->cmd)
in sdhci_send_command()? Seems you only allow to queue one command, but not sure how you
guarantee that.


Thanks,
Ming

  reply	other threads:[~2018-07-31 16:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 17:28 [Regression] Linux-Next Merge 25Jul2018 breaks mmc on Tegra Peter Geis
2018-07-25 18:17 ` Jens Axboe
2018-07-25 18:29   ` Peter Geis
2018-07-27 19:31     ` Jens Axboe
2018-07-28  6:22       ` Ming Lei
2018-07-28 13:37     ` Ming Lei
2018-07-30 18:55       ` Peter Geis
2018-07-31  1:38         ` Ming Lei
2018-07-31 12:47           ` Peter Geis
2018-07-31 16:25             ` Ming Lei [this message]
2018-07-31 17:51               ` Peter Geis
2018-07-31 23:18                 ` Ming Lei
2018-08-02 10:09               ` Adrian Hunter
2018-08-02 10:33                 ` Ming Lei
2018-08-02 10:47                   ` Adrian Hunter
2018-08-02 11:09                     ` Ming Lei
2018-08-02 11:23                       ` Adrian Hunter
2018-08-02 12:10                         ` Peter Geis
2018-08-04  1:46                           ` Peter Geis

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=20180731162518.GA18025@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=axboe@kernel.dk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pgwipeout@gmail.com \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.