Sample Header Ad - 728x90

How do I get the linux kernel to track io stats to a block device I create in a loadable module?

0 votes
2 answers
701 views
I've been looking and looking and everybody explains the /proc/diskstats file, but nobody seems to explain where that data comes from. I found this comment:
Just remember that /proc/diskstats is tracking the kernel’s read requests–not yours.
on this page:
://kevinclosson.net/2018/10/09/no-proc-diskstats-does-not-track-your-physical-i-o-requests/
But basically my problem is that I've got a kernel module that creates a block device, and handles requests via a request handler set via blk_queue_make_request not blk_init_queue, just like dm, I don't want the kernel to queue requests for me. Everything works fine, but nothing shows up in /proc/diskstats What bit of magic am I missing to get my stats in there so it will show up in iostat? I assumed the kernel would be tallying this information since it's handling the requests to the kernel module, but apparently not. or I'm missing a flag somewhere or something. Any ideas?
Asked by stu (143 rep)
Sep 29, 2020, 11:35 AM
Last activity: Nov 10, 2020, 04:59 PM