Re: [GIT PULL 24/25] lightnvm: pblk: add iostat support

From: Matias BjÃrling
Date: Fri Jan 05 2018 - 13:33:45 EST


On 01/05/2018 04:42 PM, Jens Axboe wrote:
On Fri, Jan 05 2018, Matias Bjørling wrote:
From: Javier González <javier@xxxxxxxxxxxx>

Since pblk registers its own block device, the iostat accounting is
not automatically done for us. Therefore, add the necessary
accounting logic to satisfy the iostat interface.

Ignorant question - why is it a raw block device, not using blk-mq?

The current flow is using the raw block device, together with the blk-mq nvme device driver. A bio is sent down to the nvme_nvm_submit_io() path in the /drivers/nvme/host/lightnvm.c file. From there it attaches the to NVMe blk-mq implementation.

Is there a better way to do it?


@@ -193,9 +197,9 @@ static void pblk_end_io_read(struct nvm_rq *rqd)
__pblk_end_io_read(pblk, rqd, true);
}

-static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
- unsigned int bio_init_idx,
- unsigned long *read_bitmap)
+static int pblk_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
+ unsigned int bio_init_idx,
+ unsigned long *read_bitmap)
{
struct bio *new_bio, *bio = rqd->bio;
struct pblk_sec_meta *meta_list = rqd->meta_list;
@@ -306,6 +310,8 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
return NVM_IO_OK;

err:
+ pr_err("pblk: failed to perform partial read\n");
+
/* Free allocated pages in new bio */
pblk_bio_free_pages(pblk, bio, 0, new_bio->bi_vcnt);
__pblk_end_io_read(pblk, rqd, false);

This seems to include unrelated changes, like the rename above and the
addition of the error logging?


Grah... I missed it during review. It should have been its own patch or part of the early refactor patches. Thanks for picking it up.