[RFC PATCHv3 1/6] block: expose blk_stat_{enable,disable}_accounting() to drivers
Nilay Shroff
nilay at linux.ibm.com
Wed Oct 29 09:40:43 PDT 2025
On 10/29/25 3:09 PM, Christoph Hellwig wrote:
> On Mon, Oct 27, 2025 at 02:59:35PM +0530, Nilay Shroff wrote:
>> The functions blk_stat_enable_accounting() and
>> blk_stat_disable_accounting() are currently exported, but their
>> prototypes are only defined in a private header. Move these prototypes
>> into a common header so that block drivers can directly use these APIs.
>
> That's because they are only used by I/O scheduler, which are the only
> valid users. I don't think drivers should touch this, but I'll stay
> tuned..
>
Well, these stat APIs are already exported by the block layer, so I assumed
the intention was to allow drivers to make use of them. If that’s not the case,
then perhaps they were exported unintentionally.
On a related note, I also looked into using nvme_req(rq)->start_time, which is
initialized using jiffies when the request is submitted to the device. However,
for my use case, I need timestamp data with nanosecond precision, which is why
I opted to use the blk-stat APIs instead.
Thanks,
--Nilay
More information about the Linux-nvme
mailing list