Linux???豸????---????????
???????????? ???????[ 2016/6/20 11:24:20 ] ??????????????????? ??????
????????????
???????豸??blockdevice??
????--- ??????????????????????豸?????????豸???д???????е????????????????????????????????????????????????д???豸??????豸????????????????
????????豸??Character device??
????---????????????????豸?????????豸???д?????????е????????Щ????????????γ?????????????????????????????????????豸???д???????
????????(Sectors)???κο??豸??????????????????λ???????1?????????С?512byte???????豸?????
?????? (Blocks)????Linux?????????????????????????????λ???????1??????1????????????ɡ?????Linux???????????
??????(Segments)????????????????ɡ???Linux??????????????????????????????????
????????Ρ??顢??????????????£?
???????豸??????????
???????豸???????Linux???????????????????
???????豸????????Linux?У?????????豸??????????(I/O)??????????????豸?????????????????????request?????????????????Щ?????豸????????????????????????????????е???????ЩI/O?????????????У???????????У?????????????request_queue????????????????豸????Щ???????????????????????????????????????????Ч??????????????е?I/O??????????????????? I/O ??????????????????????????????й????? I/O ?????乤?????????豸????????У??????????е?????????????????????????????豸??
?????????(Generic Block Layer)????????????I/O?????????????????????????????????????????У?????????bio????????????I/O????
????Linux???????gendisk??????壬????????????????????豸???????????????????????з??????gendisk???????????????豸??file_operations????????????????block_device_operations???塣
????IO?????????????????????豸??????Ч??????????????????????е????????????????磺д??????????Ч?????????????????豸????????????????????????????I/O?????????????????????????????????????????к??????????Ч?????????????????????????????I/O??????????????????????elevator algorithm????????????I/O???????ɡ??????????????????????????????
????1 noop????????FIFO?????????????????????
????2 anticipatory?????I/O????????????????????????
????3 Deadline?????anticipatory?????и????????????????
????4 Cfq?????????I/O?????????????
????PS?????IO?????????????????????????????????????????????á?
????????(Mapping Layer)??????????????????????????豸??????
????VFS??????????????????????????????????????????????????ext2??FAT??NFS???豸?????
???????????(Caches):??????????????????????С?
????????????
????block_device: ????????????????????????????????豸???
????gendisk: ??????????????generic hard disk??????
????hd_struct: ??????????е???????
????bio: ??????????????????????????????driver
????request: ?????????????????б?????????д????
????request_queue: ???????????request??????????????????дBIO?γ???С?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11