Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
we know that the disk read or write couple of fix size (say 64k).
what if i got an io smaller than 64k for example 30k. what will the os do?
Does the os need to read the 64k from the disk first then write the update 64k to the disk?
help me.
Yes. If a process requests a read of less than the block size, the driver needs to read and cache the block, writing back the changed block when you write back to disk.
The blocks cached by the OS do not *need* to be the same size as the clusters on your disk. They can be smaller. But it makes things a bit more complicated if they are different sizes. My OS reads and writes in 32K chunks, for any cluster size larger than 32K.
AJ wrote:Yes. If a process requests a read of less than the block size, the driver needs to read and cache the block, writing back the changed block when you write back to disk.
Cheers,
Adam
Thank you
then what is the default io size for a disk. Can I change it?
for example i got an aplication io size 30k. i want to change the disk io size to 32k making it more efficient.
AJ wrote:Yes. If a process requests a read of less than the block size, the driver needs to read and cache the block, writing back the changed block when you write back to disk.
Cheers,
Adam
Thank you
then what is the default io size for a disk. Can I change it?
for example i got an aplication io size 30k. i want to change the disk io size to 32k making it more efficient.
Disks, such as hard drives and floppy drives, work in blocks of 512 bytes(normally, of course their are exceptions.) CDs work in blocks on 2048 blocks IIRC. The OS however could have larger block sizes of say 4096 bytes. Also some filesystems have bigger blocks such as 4096 or higher.