it is normal for linux to read a block of size more than 4KB (or several blocks of 4KB each) at a time?

不想你离开。 提交于 2019-12-10 11:36:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!