Set the max transactions for NVMe drives better.

Provided a better estimate for the number of transactions that can be
pending at one time. This will be number of queues * number of
trackers / 4, as suggested by Jim Harris. This gives a better estimate
of the number of transactions that CAM should queue before applying
back pressure. This should be revisted when we have real multi-queue
support in CAM and the upper layers of the I/O stack.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-08-28 23:54:20 +00:00
parent be650b3469
commit c02565f9fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322994
3 changed files with 10 additions and 1 deletions

View File

@ -145,6 +145,14 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller *ctrlr)
*/
num_trackers = min(num_trackers, (num_entries-1));
/*
* Our best estimate for the maximum number of I/Os that we should
* noramlly have in flight at one time. This should be viewed as a hint,
* not a hard limit and will need to be revisitted when the upper layers
* of the storage system grows multi-queue support.
*/
ctrlr->max_hw_pend_io = num_trackers * ctrlr->num_io_queues / 4;
/*
* This was calculated previously when setting up interrupts, but
* a controller could theoretically support fewer I/O queues than

View File

@ -263,6 +263,7 @@ struct nvme_controller {
uint32_t num_io_queues;
uint32_t num_cpus_per_ioq;
uint32_t max_hw_pend_io;
/* Fields for tracking progress during controller initialization. */
struct intr_config_hook config_hook;

View File

@ -253,7 +253,7 @@ nvme_sim_new_controller(struct nvme_controller *ctrlr)
int unit;
struct nvme_sim_softc *sc = NULL;
max_trans = ctrlr->num_io_queues;
max_trans = ctrlr->max_hw_pend_io;
unit = device_get_unit(ctrlr->dev);
devq = cam_simq_alloc(max_trans);
if (devq == NULL)