Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1447750
| From | Bob Liu <bob.liu@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() |
| Date | 2016-07-21 11:50 +0200 |
| Message-ID | <rXiMa-5GH-11@gated-at.bofh.it> (permalink) |
| References | <rV7Lc-5c0-7@gated-at.bofh.it> <rV7Lc-5c0-17@gated-at.bofh.it> <rXhwJ-4Xt-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/21/2016 04:29 PM, Roger Pau Monné wrote:
> On Fri, Jul 15, 2016 at 05:31:48PM +0800, Bob Liu wrote:
>> blk_mq_update_nr_hw_queues() reset all queue limits to default which it's not
>> as xen-blkfront expected, introducing blkif_set_queue_limits() to reset limits
>> with initial correct values.
>
> Hm, great, and as usual in Linux there isn't even a comment in the function
> that explains what it is supposed to do, or what are the side-effects of
> calling blk_mq_update_nr_hw_queues.
>
>> Signed-off-by: Bob Liu <bob.liu@oracle.com>
>>
>> drivers/block/xen-blkfront.c | 91 ++++++++++++++++++++++++--------------------
>> 1 file changed, 50 insertions(+), 41 deletions(-)
>>
>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>> index 032fc94..10f46a8 100644
>> --- a/drivers/block/xen-blkfront.c
>> +++ b/drivers/block/xen-blkfront.c
>> @@ -189,6 +189,8 @@ struct blkfront_info
>> struct mutex mutex;
>> struct xenbus_device *xbdev;
>> struct gendisk *gd;
>> + u16 sector_size;
>> + unsigned int physical_sector_size;
>> int vdevice;
>> blkif_vdev_t handle;
>> enum blkif_state connected;
>> @@ -913,9 +915,45 @@ static struct blk_mq_ops blkfront_mq_ops = {
>> .map_queue = blk_mq_map_queue,
>> };
>>
>> +static void blkif_set_queue_limits(struct blkfront_info *info)
>> +{
>> + struct request_queue *rq = info->rq;
>> + struct gendisk *gd = info->gd;
>> + unsigned int segments = info->max_indirect_segments ? :
>> + BLKIF_MAX_SEGMENTS_PER_REQUEST;
>> +
>> + queue_flag_set_unlocked(QUEUE_FLAG_VIRT, rq);
>> +
>> + if (info->feature_discard) {
>> + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, rq);
>> + blk_queue_max_discard_sectors(rq, get_capacity(gd));
>> + rq->limits.discard_granularity = info->discard_granularity;
>> + rq->limits.discard_alignment = info->discard_alignment;
>> + if (info->feature_secdiscard)
>> + queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, rq);
>> + }
>
> AFAICT, at the point this function is called (in blkfront_resume), the
> value of info->feature_discard is still from the old backend, maybe this
> should be called from blkif_recover after blkfront_gather_backend_features?
>
Thank you for pointing out, will be fixed.
--
Regards,
-Bob
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] xen-blkfront: fix places not updated after introducing 64KB page granularity Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
[PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 11:00 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-21 12:10 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 09:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-22 10:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 11:40 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-22 11:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 13:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-23 00:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 11:30 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 12:30 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 13:00 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 13:10 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 14:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 14:30 +0200
[PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
Re: [PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 10:30 +0200
Re: [PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Bob Liu <bob.liu@oracle.com> - 2016-07-21 11:50 +0200
Re: [PATCH 1/3] xen-blkfront: fix places not updated after introducing 64KB page granularity Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 10:10 +0200
csiph-web