From: Bob Liu <bob.liu@oracle.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
konrad.wilk@oracle.com
Subject: Re: [PATCH v3] xen-blkfront: dynamic configuration of per-vbd resources
Date: Thu, 28 Jul 2016 07:05:05 +0800 [thread overview]
Message-ID: <57993E21.7050409@oracle.com> (raw)
In-Reply-To: <20160727142420.esp7aharesu45ixr@mac>
On 07/27/2016 10:24 PM, Roger Pau Monné wrote:
> On Wed, Jul 27, 2016 at 07:21:05PM +0800, Bob Liu wrote:
>>
>> On 07/27/2016 06:59 PM, Roger Pau Monné wrote:
>>> On Wed, Jul 27, 2016 at 11:21:25AM +0800, Bob Liu wrote:
>>> [...]
>>>> +static ssize_t dynamic_reconfig_device(struct blkfront_info *info, ssize_t count)
>>>> +{
>>>> + /*
>>>> + * Prevent new requests even to software request queue.
>>>> + */
>>>> + blk_mq_freeze_queue(info->rq);
>>>> +
>>>> + /*
>>>> + * Guarantee no uncompleted reqs.
>>>> + */
>>>
>>> I'm also wondering, why do you need to guarantee that there are no
>>> uncompleted requests? The resume procedure is going to call blkif_recover
>>> that will take care of requeuing any unfinished requests that are on the
>>> ring.
>>>
>>
>> Because there may have requests in the software request queue with more segments than
>> we can handle(if info->max_indirect_segments is reduced).
>>
>> The blkif_recover() can't handle this since blk-mq was introduced,
>> because there is no way to iterate the sw-request queues(blk_fetch_request() can't be used by blk-mq).
>>
>> So there is a bug in blkif_recover(), I was thinking implement the suspend function of blkfront_driver like:
>
> Hm, this is a regression and should be fixed ASAP. I'm still not sure I
> follow, don't blk_queue_max_segments change the number of segments the
> requests on the queue are going to have? So that you will only have to
> re-queue the requests already on the ring?
>
That's not enough, request queues were split to software queues and hardware queues since blk-mq was introduced.
We need to consider two more things:
* Stop new requests be added to software queues before blk_queue_max_segments() is called(still using old 'max-indirect-segments').
I didn't see other way except call blk_mq_freeze_queue().
* Requests already in software queues but with old 'max-indirect-segments' also have to be re-queued based on new 'max-indirect-segments'.
Neither blk-mq API can do this.
> Waiting for the whole queue to be flushed before suspending is IMHO not
> acceptable, it introduces an unbounded delay during migration if the backend
> is slow for some reason.
>
Right, I also hope there is better solution.
--
Regards,
-Bob
next prev parent reply other threads:[~2016-07-27 23:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-27 3:21 [PATCH v3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu
2016-07-27 8:07 ` Roger Pau Monné
2016-07-27 9:12 ` Bob Liu
2016-07-27 9:29 ` Paul Durrant
2016-07-27 9:29 ` [Xen-devel] " Paul Durrant
2016-07-27 10:09 ` Roger Pau Monné
2016-07-27 10:09 ` Roger Pau Monné
2016-07-27 9:12 ` Bob Liu
2016-07-27 8:07 ` Roger Pau Monné
2016-07-27 10:59 ` Roger Pau Monné
2016-07-27 10:59 ` Roger Pau Monné
2016-07-27 11:21 ` Bob Liu
2016-07-27 11:21 ` Bob Liu
2016-07-27 14:24 ` Roger Pau Monné
2016-07-27 14:24 ` Roger Pau Monné
2016-07-27 23:05 ` Bob Liu
2016-07-27 23:05 ` Bob Liu [this message]
2016-07-28 7:49 ` Roger Pau Monné
2016-07-28 7:49 ` Roger Pau Monné
2016-07-28 9:31 ` [Xen-devel] " David Vrabel
2016-07-28 9:31 ` David Vrabel
-- strict thread matches above, loose matches on Subject: below --
2016-07-27 3:21 Bob Liu
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=57993E21.7050409@oracle.com \
--to=bob.liu@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.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.