From: Seungwon Jeon <tgih.jun@samsung.com>
To: 'Konstantin Dorfman' <kdorfman@codeaurora.org>
Cc: cjb@laptop.org, linux-mmc@vger.kernel.org,
'Per Forlin' <per.lkml@gmail.com>
Subject: RE: [RESEND PATCH v4] mmc: fix async request mechanism for sequential read scenarios
Date: Thu, 20 Dec 2012 16:39:52 +0900 [thread overview]
Message-ID: <003901cdde85$32a9d520$97fd7f60$%jun@samsung.com> (raw)
In-Reply-To: <50D09324.1000502@codeaurora.org>
On Wednesday, December 19, 2012, Konstantin Dorfman wrote:
> On 12/17/2012 02:26 PM, Seungwon Jeon wrote:
> > Hi, Konstantin.
> >
> > I added comments more below.
> I've answered below.
> >
> > On Wednesday, December 12, 2012, Seungwon Jeon wrote:
> >> On Monday, December 10, 2012, Konstantin Dorfman wrote:
> >>> /*
> >>> * Prepare a MMC request. This just filters out odd stuff.
> >>> @@ -63,11 +62,20 @@ static int mmc_queue_thread(void *d)
> >>> set_current_state(TASK_INTERRUPTIBLE);
> >>> req = blk_fetch_request(q);
> >>> mq->mqrq_cur->req = req;
> >>> + if (!req && mq->mqrq_prev->req &&
> >>> + !(mq->mqrq_prev->req->cmd_flags & REQ_FLUSH) &&
> >>> + !(mq->mqrq_prev->req->cmd_flags & REQ_DISCARD))
> >>> + mq->card->host->context_info.is_waiting_last_req = true;
> >>> +
> > Unlike normal R/W request, request for discard/flush will be finished synchronously.
> > That means blk_end_request is called with 1's cycle of 'issue_fn' and request will be freed in block
> layer.
> > Currently 'mqrq_prev->req' is keeping these request and is used above condition.
> > Maybe, same area may be reallocated for normal R/W request after discard/flush is finished.
> > But we still expect discard or flush is saved in 'mq->mqrq_prev->req'.
> > I wonder that 'mq->mqrq_prev->req' indicates the valid area in all case.
>
> It seems like a bug causing unnecessary call to `issue_fn(mq, req)` even
> when `req` is NULL, because 'mq->mqrq_prev->req' that holds old control
> request is not NULL. It is not directly related to the patch, it could
> be fixed by cleaning 'mq->mqrq_prev->req' (for control requests). I
> think this should be done in separate patch.
Yes, it's different issue. I've already checked it.
But I'm seeing whether cmd_flag of 'mq->mqrq_prev->req' is valid or not after blk_end_request is completed.
As it's mentioned above, special requests are completed at once.
>
> Also this action (context_info.is_waiting_last_req = true;) could be
> moved into card/block.c: mmc_blk_issue_rq() function just for the case,
> when request is data request. Do you think it will be cleaner?
Wherever it is moved, we need other condition to decide whether last data transfer is ongoing.
'card->host->areq' could be good condition.
> >>> @@ -2086,6 +2186,12 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
> >>>
> >>> mmc_send_if_cond(host, host->ocr_avail);
> >>>
> >>> + spin_lock_init(&host->context_info.lock);
> >>> + host->context_info.is_new_req = false;
> >>> + host->context_info.is_done_rcv = false;
> >>> + host->context_info.is_waiting_last_req = false;
> >>> + init_waitqueue_head(&host->context_info.wait);
> >>> +
> >> This path may be retired when mmc_rescan_try_freq is failed.
> >> How about putting these in mmc_add_card(mmc/core/bus.c)
> >> <Quote>
> >> ret = device_add(&card->dev);
> >> if (ret)
> >> return ret;
> >> -> Here seems good point.
> It is ok to put the initialization just before calling to "device_add",
> because data requests starting to arrive immediately after device_add().
> I've tested this already and will post soon.
Yes, it's reasonable.
Thanks,
Seungwon Jeon
> >>
> >> mmc_card_set_present(card);
> >> </Quote>
> >> Thanks,
> >> Seungwon Jeon
next prev parent reply other threads:[~2012-12-20 7:39 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <n@samsung.com>
2012-08-05 13:08 ` [RFC/PATCH] mmc: core: Add support for idle time BKOPs Maya Erez
2012-08-30 7:36 ` Jaehoon Chung
2012-09-04 5:42 ` merez
2012-10-04 22:28 ` [PATCH v2] mmc: core: Add support for idle time BKOPS Maya Erez
2012-10-09 3:52 ` merez
2012-10-16 7:53 ` Jaehoon Chung
2012-11-07 4:28 ` merez
2012-11-08 5:26 ` Jaehoon Chung
2012-11-11 9:25 ` Subhash Jadavani
2012-10-18 16:31 ` [PATCH 1/6] mmc: core: sdio_io.c: Fixed lines with > 80 chars Sangho Yi
2012-10-18 16:31 ` [PATCH 2/6] mmc: core: sdio_bus.c: Removed trailing whitespace error Sangho Yi
2012-10-18 16:31 ` [PATCH 3/6] mmc: core: sdio_bus.c: Fixed lines > 80 chars Sangho Yi
2012-10-18 23:54 ` Jaehoon Chung
2012-10-18 16:31 ` [PATCH 4/6] mmc: core: sdio_bus.c: Removed space between func name and () Sangho Yi
2012-10-18 16:31 ` [PATCH 5/6] mmc: core: sdio_bus.c: Fixed a warning for the pr_warning( Sangho Yi
2012-10-18 16:31 ` [PATCH 6/6] mmc: core: sdio_bus.c: Removed unnecessary NULL check routine Sangho Yi
2012-10-18 16:47 ` [PATCH 1/6] mmc: core: sdio_io.c: Fixed lines with > 80 chars Joe Perches
2012-11-01 14:40 ` [PATCH v2] mmc: fix async request mechanism for sequential read scenarios Konstantin Dorfman
2012-11-05 6:20 ` Per Förlin
2012-11-05 7:15 ` Jaehoon Chung
2012-11-12 12:10 ` Konstantin Dorfman
2012-11-08 10:41 ` Jaehoon Chung
2012-11-08 12:51 ` merez
2012-11-09 5:46 ` Jaehoon Chung
2012-11-12 12:49 ` Konstantin Dorfman
2012-11-06 8:40 ` Jaehoon Chung
2012-11-12 12:42 ` Konstantin Dorfman
2012-11-12 16:51 ` [PATCH v3] " Konstantin Dorfman
2012-11-13 13:42 ` Seungwon Jeon
2012-11-15 10:23 ` Seungwon Jeon
2012-11-20 2:05 ` Seungwon Jeon
2012-11-25 11:56 ` [PATCH v3] mmc: core: Add support for idle time BKOPS Maya Erez
2012-11-25 12:46 ` merez
2012-11-28 14:22 ` Chris Ball
2012-11-29 12:40 ` Jaehoon Chung
2012-12-03 9:49 ` merez
2012-12-04 9:52 ` Ulf Hansson
2012-12-04 21:17 ` merez
2012-12-06 10:18 ` Ulf Hansson
2012-12-12 12:32 ` merez
2012-12-13 10:17 ` Ulf Hansson
2012-12-21 8:35 ` Maya Erez
2012-12-21 9:56 ` Ulf Hansson
2012-12-21 10:24 ` Jaehoon Chung
2012-12-05 13:38 ` [PATCH v4] mmc: fix async request mechanism for sequential read scenarios Konstantin Dorfman
2012-12-06 5:24 ` Seungwon Jeon
2012-12-06 14:23 ` Konstantin Dorfman
2012-12-10 14:23 ` [RESEND PATCH " Konstantin Dorfman
2012-12-12 9:26 ` Seungwon Jeon
2012-12-17 12:26 ` Seungwon Jeon
2012-12-18 16:00 ` Konstantin Dorfman
2012-12-18 16:19 ` Chris Ball
2012-12-20 7:39 ` Seungwon Jeon [this message]
2012-12-26 9:26 ` [PATCH v5] " Konstantin Dorfman
2012-12-28 10:16 ` Seungwon Jeon
2013-01-14 19:31 ` Chris Ball
2013-01-15 12:00 ` Konstantin Dorfman
2013-01-22 10:48 ` [PATCH 1/2] mmc: core: fix permanent sleep of mmcqd during card removal Seungwon Jeon
2013-01-31 11:05 ` Jaehoon Chung
2013-01-31 11:25 ` Seungwon Jeon
2013-02-08 12:07 ` Konstantin Dorfman
2013-02-11 17:00 ` Chris Ball
2013-01-30 6:30 ` Seungwon Jeon
2013-01-31 6:53 ` Subhash Jadavani
2013-02-04 11:43 ` Subhash Jadavani
2013-02-05 5:57 ` Seungwon Jeon
2013-02-05 7:05 ` Jaehoon Chung
2013-02-05 7:32 ` Subhash Jadavani
2013-02-04 19:27 ` Konstantin Dorfman
2013-01-10 20:15 ` [PATCH v5 0/3] Add support for periodic BKOPS Maya Erez
2013-01-11 11:33 ` Jaehoon Chung
2014-11-10 17:13 ` [PATCH 0/3] mmc: Support FFU for eMMC v5.0 Avi Shchislowski
2014-11-11 3:33 ` Jaehoon Chung
2014-11-10 17:13 ` [PATCH 1/3] " Avi Shchislowski
2014-11-11 3:07 ` Jaehoon Chung
2014-11-11 8:44 ` Avi Shchislowski
2014-11-10 17:18 ` [PATCH 2/3] " Avi Shchislowski
2014-11-11 3:30 ` Jaehoon Chung
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='003901cdde85$32a9d520$97fd7f60$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=cjb@laptop.org \
--cc=kdorfman@codeaurora.org \
--cc=linux-mmc@vger.kernel.org \
--cc=per.lkml@gmail.com \
/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).