From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "jianchao.w.wang@oracle.com" <jianchao.w.wang@oracle.com>,
"axboe@kernel.dk" <axboe@kernel.dk>, "hch@lst.de" <hch@lst.de>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"hare@suse.com" <hare@suse.com>,
"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>
Subject: Re: [PATCH v5 5/9] block: Change the runtime power management approach (1/2)
Date: Thu, 9 Aug 2018 10:52:06 +0800 [thread overview]
Message-ID: <20180809025204.GC18139@ming.t460p> (raw)
In-Reply-To: <2c3fa0fddb9118fb7a5584935fa79b19b062abcb.camel@wdc.com>
On Wed, Aug 08, 2018 at 05:28:43PM +0000, Bart Van Assche wrote:
> On Wed, 2018-08-08 at 14:43 +0800, jianchao.wang wrote:
> >
> > On 08/08/2018 02:11 PM, jianchao.wang wrote:
> > > Hi Bart
> > >
> > > On 08/08/2018 06:51 AM, Bart Van Assche wrote:
> > > > @@ -391,6 +393,9 @@ static struct request *blk_mq_get_request(struct request_queue *q,
> > > > }
> > > > }
> > > > data->hctx->queued++;
> > > > +
> > > > + blk_pm_add_request(q, rq);
> > > > +
> > > > return rq;
> > > > }
> > >
> > > The request_queue is in pm_only mode when suspended, who can reach here to do the resume ?
> >
> > I mean, in the original blk-legacy runtime pm implementation, any new IO could trigger the resume,
> > after your patch set, only the pm request could pass the blk_queue_enter while the queue is suspended
> > and in pm-only mode. But if no resume, where does the pm request come from ?
> >
> > The blk_pm_add_request should be added to blk_queue_enter.
> > It looks like as following:
> > 1. when an normal io reaches blk_queue_enter, if queue is in suspended mode, it invoke blk_pm_add_request
> > to trigger the resume, then wait here for the pm_only mode to be cleared.
> > 2. the runtime pm core does the resume work and clear the pm_only more finally
> > 3. the task blocked in blk_queue_enter is waked up and proceed.
>
> Hello Jianchao,
>
> Some but not all blk_queue_enter() calls are related to request allocation so
The only one I remember is scsi_ioctl_reset(), in which scsi_autopm_get_host()
is called before allocating this request, that means it is enough to put
host up for handling RESET. Also this request shouldn't have entered the block
request queue.
Or are there other cases in which request allocation isn't related with
blk_queue_enter()?
thanks,
Ming
next prev parent reply other threads:[~2018-08-09 2:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 22:51 [PATCH v5 0/9] blk-mq: Implement runtime power management Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 1/9] block: Change the preempt-only flag into a counter Bart Van Assche
2018-08-08 8:21 ` Ming Lei
2018-08-08 15:27 ` Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 2/9] block: Move power management code into a new source file Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 3/9] block, scsi: Introduce blk_pm_runtime_exit() Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 4/9] percpu-refcount: Introduce percpu_ref_is_in_use() Bart Van Assche
2018-08-08 15:23 ` Tejun Heo
2018-08-09 14:32 ` Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 5/9] block: Change the runtime power management approach (1/2) Bart Van Assche
2018-08-08 6:11 ` jianchao.wang
2018-08-08 6:43 ` jianchao.wang
2018-08-08 17:28 ` Bart Van Assche
2018-08-09 2:52 ` Ming Lei [this message]
2018-08-09 17:12 ` Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 6/9] block: Change the runtime power management approach (2/2) Bart Van Assche
2018-08-08 8:50 ` Ming Lei
2018-08-08 17:32 ` Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 7/9] block: Remove blk_pm_requeue_request() Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 8/9] blk-mq: Insert a blk_pm_put_request() call Bart Van Assche
2018-08-07 22:51 ` [PATCH v5 9/9] blk-mq: Enable support for runtime power management Bart Van Assche
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=20180809025204.GC18139@ming.t460p \
--to=ming.lei@redhat.com \
--cc=Bart.VanAssche@wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jianchao.w.wang@oracle.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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