问题
I am writing a device driver for a network attached hard drive and my problem is that I can see that Linux is sending requests to my block device that exceed the typical 4KB requests. Actually, the behavior I can notice is that. It sends a request of 4kB first, then the second request is of size 8KB, then 16KB and so on. Is there any way to disable this behavior and limit Linux to send requests of 4KB at a time? or is this something bad in my code?
- How I calculated the request total size: I have the sector size set to 512 bytes. And when I call
blk_rq_sectors
on any request I get the number of sectors stated in that request. Sometimes, I see requests consist of 8, 16, 32, or 64 sectors.
Thanks.
来源:https://stackoverflow.com/questions/19574066/it-is-normal-for-linux-to-read-a-block-of-size-more-than-4kb-or-several-blocks