Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
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
  ...
  • Loading branch information
Linus Torvalds committed Jul 11, 2017
2 parents 908b852 + b222dd2 commit 130568d
Show file tree
Hide file tree
Showing 40 changed files with 600 additions and 440 deletions.
6 changes: 2 additions & 4 deletions Documentation/block/data-integrity.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ will require extra work due to the application tag.
supported by the block device.


int bio_integrity_prep(bio);
bool bio_integrity_prep(bio);

To generate IMD for WRITE and to set up buffers for READ, the
filesystem must call bio_integrity_prep(bio).
Expand All @@ -201,9 +201,7 @@ will require extra work due to the application tag.
sector must be set, and the bio should have all data pages
added. It is up to the caller to ensure that the bio does not
change while I/O is in progress.

bio_integrity_prep() should only be called if
bio_integrity_enabled() returned 1.
Complete bio with error if prepare failed for some reson.


5.3 PASSING EXISTING INTEGRITY METADATA
Expand Down
14 changes: 10 additions & 4 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3483,11 +3483,17 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, struct bfq_queue *bfqq)
}
}
}
/* Update weight both if it must be raised and if it must be lowered */
/*
* To improve latency (for this or other queues), immediately
* update weight both if it must be raised and if it must be
* lowered. Since, entity may be on some active tree here, and
* might have a pending change of its ioprio class, invoke
* next function with the last parameter unset (see the
* comments on the function).
*/
if ((entity->weight > entity->orig_weight) != (bfqq->wr_coeff > 1))
__bfq_entity_update_weight_prio(
bfq_entity_service_tree(entity),
entity);
__bfq_entity_update_weight_prio(bfq_entity_service_tree(entity),
entity, false);
}

/*
Expand Down
3 changes: 2 additions & 1 deletion block/bfq-iosched.h
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ void bfq_put_idle_entity(struct bfq_service_tree *st,
struct bfq_entity *entity);
struct bfq_service_tree *
__bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
struct bfq_entity *entity);
struct bfq_entity *entity,
bool update_class_too);
void bfq_bfqq_served(struct bfq_queue *bfqq, int served);
void bfq_bfqq_charge_time(struct bfq_data *bfqd, struct bfq_queue *bfqq,
unsigned long time_ms);
Expand Down
39 changes: 34 additions & 5 deletions block/bfq-wf2q.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,28 @@ struct bfq_service_tree *bfq_entity_service_tree(struct bfq_entity *entity)
return sched_data->service_tree + idx;
}


/*
* Update weight and priority of entity. If update_class_too is true,
* then update the ioprio_class of entity too.
*
* The reason why the update of ioprio_class is controlled through the
* last parameter is as follows. Changing the ioprio class of an
* entity implies changing the destination service trees for that
* entity. If such a change occurred when the entity is already on one
* of the service trees for its previous class, then the state of the
* entity would become more complex: none of the new possible service
* trees for the entity, according to bfq_entity_service_tree(), would
* match any of the possible service trees on which the entity
* is. Complex operations involving these trees, such as entity
* activations and deactivations, should take into account this
* additional complexity. To avoid this issue, this function is
* invoked with update_class_too unset in the points in the code where
* entity may happen to be on some tree.
*/
struct bfq_service_tree *
__bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
struct bfq_entity *entity)
struct bfq_entity *entity,
bool update_class_too)
{
struct bfq_service_tree *new_st = old_st;

Expand Down Expand Up @@ -739,9 +757,15 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
bfq_weight_to_ioprio(entity->orig_weight);
}

if (bfqq)
if (bfqq && update_class_too)
bfqq->ioprio_class = bfqq->new_ioprio_class;
entity->prio_changed = 0;

/*
* Reset prio_changed only if the ioprio_class change
* is not pending any longer.
*/
if (!bfqq || bfqq->ioprio_class == bfqq->new_ioprio_class)
entity->prio_changed = 0;

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

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

/*
Expand Down
Loading

0 comments on commit 130568d

Please sign in to comment.