lkml.org 
[lkml]   [2019]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v8 13/13] nvmet-passthru: support block accounting


On 2019-09-06 6:00 p.m., Sagi Grimberg wrote:
>
>> Support block disk accounting by setting the RQF_IO_STAT flag
>> and gendisk in the request.
>>
>> After this change, IO counts will be reflected correctly in
>> /proc/diskstats for drives being used by passthru.
>>
>> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
>> ---
>> drivers/nvme/target/io-cmd-passthru.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/target/io-cmd-passthru.c b/drivers/nvme/target/io-cmd-passthru.c
>> index 7557927a3451..63f12750a80d 100644
>> --- a/drivers/nvme/target/io-cmd-passthru.c
>> +++ b/drivers/nvme/target/io-cmd-passthru.c
>> @@ -410,6 +410,9 @@ static struct request *nvmet_passthru_blk_make_request(struct nvmet_req *req,
>> if (unlikely(IS_ERR(rq)))
>> return rq;
>>
>> + if (blk_queue_io_stat(q) && cmd->common.opcode != nvme_cmd_flush)
>> + rq->rq_flags |= RQF_IO_STAT;

Thanks for the review!

> Does flush has data bytes in the request? Why the special casing?

Well it was special cased in the vanilla blk account flow... But I think
it's required to be special cased so the IO and in_flight counts don't
count flushes (as they do not for regular block device traffic).

Logan

\
 
 \ /
  Last update: 2019-09-09 18:07    [W:2.177 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site