Skip to content

Commit 130568d

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull more block updates from Jens Axboe: "This is a followup for block changes, that didn't make the initial pull request. It's a bit of a mixed bag, this contains: - A followup pull request from Sagi for NVMe. Outside of fixups for NVMe, it also includes a series for ensuring that we properly quiesce hardware queues when browsing live tags. - Set of integrity fixes from Dmitry (mostly), fixing various issues for folks using DIF/DIX. - Fix for a bug introduced in cciss, with the req init changes. From Christoph. - Fix for a bug in BFQ, from Paolo. - Two followup fixes for lightnvm/pblk from Javier. - Depth fix from Ming for blk-mq-sched. - Also from Ming, performance fix for mtip32xx that was introduced with the dynamic initialization of commands" * 'for-linus' of git://git.kernel.dk/linux-block: (44 commits) block: call bio_uninit in bio_endio nvmet: avoid unneeded assignment of submit_bio return value nvme-pci: add module parameter for io queue depth nvme-pci: compile warnings in nvme_alloc_host_mem() nvmet_fc: Accept variable pad lengths on Create Association LS nvme_fc/nvmet_fc: revise Create Association descriptor length lightnvm: pblk: remove unnecessary checks lightnvm: pblk: control I/O flow also on tear down cciss: initialize struct scsi_req null_blk: fix error flow for shared tags during module_init block: Fix __blkdev_issue_zeroout loop nvme-rdma: unconditionally recycle the request mr nvme: split nvme_uninit_ctrl into stop and uninit virtio_blk: quiesce/unquiesce live IO when entering PM states mtip32xx: quiesce request queues to make sure no submissions are inflight nbd: quiesce request queues to make sure no submissions are inflight nvme: kick requeue list when requeueing a request instead of when starting the queues nvme-pci: quiesce/unquiesce admin_q instead of start/stop its hw queues nvme-loop: quiesce/unquiesce admin_q instead of start/stop its hw queues nvme-fc: quiesce/unquiesce admin_q instead of start/stop its hw queues ...
2 parents 908b852 + b222dd2 commit 130568d

40 files changed

+600
-440
lines changed

Documentation/block/data-integrity.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ will require extra work due to the application tag.
192192
supported by the block device.
193193

194194

195-
int bio_integrity_prep(bio);
195+
bool bio_integrity_prep(bio);
196196

197197
To generate IMD for WRITE and to set up buffers for READ, the
198198
filesystem must call bio_integrity_prep(bio).
@@ -201,9 +201,7 @@ will require extra work due to the application tag.
201201
sector must be set, and the bio should have all data pages
202202
added. It is up to the caller to ensure that the bio does not
203203
change while I/O is in progress.
204-
205-
bio_integrity_prep() should only be called if
206-
bio_integrity_enabled() returned 1.
204+
Complete bio with error if prepare failed for some reson.
207205

208206

209207
5.3 PASSING EXISTING INTEGRITY METADATA

block/bfq-iosched.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3483,11 +3483,17 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, struct bfq_queue *bfqq)
34833483
}
34843484
}
34853485
}
3486-
/* Update weight both if it must be raised and if it must be lowered */
3486+
/*
3487+
* To improve latency (for this or other queues), immediately
3488+
* update weight both if it must be raised and if it must be
3489+
* lowered. Since, entity may be on some active tree here, and
3490+
* might have a pending change of its ioprio class, invoke
3491+
* next function with the last parameter unset (see the
3492+
* comments on the function).
3493+
*/
34873494
if ((entity->weight > entity->orig_weight) != (bfqq->wr_coeff > 1))
3488-
__bfq_entity_update_weight_prio(
3489-
bfq_entity_service_tree(entity),
3490-
entity);
3495+
__bfq_entity_update_weight_prio(bfq_entity_service_tree(entity),
3496+
entity, false);
34913497
}
34923498

34933499
/*

block/bfq-iosched.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,8 @@ void bfq_put_idle_entity(struct bfq_service_tree *st,
892892
struct bfq_entity *entity);
893893
struct bfq_service_tree *
894894
__bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
895-
struct bfq_entity *entity);
895+
struct bfq_entity *entity,
896+
bool update_class_too);
896897
void bfq_bfqq_served(struct bfq_queue *bfqq, int served);
897898
void bfq_bfqq_charge_time(struct bfq_data *bfqd, struct bfq_queue *bfqq,
898899
unsigned long time_ms);

block/bfq-wf2q.c

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,28 @@ struct bfq_service_tree *bfq_entity_service_tree(struct bfq_entity *entity)
694694
return sched_data->service_tree + idx;
695695
}
696696

697-
697+
/*
698+
* Update weight and priority of entity. If update_class_too is true,
699+
* then update the ioprio_class of entity too.
700+
*
701+
* The reason why the update of ioprio_class is controlled through the
702+
* last parameter is as follows. Changing the ioprio class of an
703+
* entity implies changing the destination service trees for that
704+
* entity. If such a change occurred when the entity is already on one
705+
* of the service trees for its previous class, then the state of the
706+
* entity would become more complex: none of the new possible service
707+
* trees for the entity, according to bfq_entity_service_tree(), would
708+
* match any of the possible service trees on which the entity
709+
* is. Complex operations involving these trees, such as entity
710+
* activations and deactivations, should take into account this
711+
* additional complexity. To avoid this issue, this function is
712+
* invoked with update_class_too unset in the points in the code where
713+
* entity may happen to be on some tree.
714+
*/
698715
struct bfq_service_tree *
699716
__bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
700-
struct bfq_entity *entity)
717+
struct bfq_entity *entity,
718+
bool update_class_too)
701719
{
702720
struct bfq_service_tree *new_st = old_st;
703721

@@ -739,9 +757,15 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
739757
bfq_weight_to_ioprio(entity->orig_weight);
740758
}
741759

742-
if (bfqq)
760+
if (bfqq && update_class_too)
743761
bfqq->ioprio_class = bfqq->new_ioprio_class;
744-
entity->prio_changed = 0;
762+
763+
/*
764+
* Reset prio_changed only if the ioprio_class change
765+
* is not pending any longer.
766+
*/
767+
if (!bfqq || bfqq->ioprio_class == bfqq->new_ioprio_class)
768+
entity->prio_changed = 0;
745769

746770
/*
747771
* NOTE: here we may be changing the weight too early,
@@ -867,7 +891,12 @@ static void bfq_update_fin_time_enqueue(struct bfq_entity *entity,
867891
{
868892
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
869893

870-
st = __bfq_entity_update_weight_prio(st, entity);
894+
/*
895+
* When this function is invoked, entity is not in any service
896+
* tree, then it is safe to invoke next function with the last
897+
* parameter set (see the comments on the function).
898+
*/
899+
st = __bfq_entity_update_weight_prio(st, entity, true);
871900
bfq_calc_finish(entity, entity->budget);
872901

873902
/*

0 commit comments

Comments
 (0)