1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| 1. 用户接口层 libc -> write
2. 系统调用层 sys_write -> vfs -> ext4 -> pagecache kworker -> [writeback](flush-xxx) -> wb_do_writeback -> writeback_sb_inodes -> do_writepages -> ext4_writepages -> submit_io ext4_writepages -> [jbd2/xxx](jbd2_journal)
generic_make_request -> blk_queue_bio | [kblockd] --- __blk_run_queue -> request_fn
3. 驱动层: mmc_request_fn -> mmc_queue_thread(mmcqd/xxx) -> blk_fetch_request -> mmc_blk_issue_rq -> mmc_start_areq -> mmc_start_request (host:pre -> request -> post) --> sdhci_request -> sdhci_send_command 优化: 1. 理论上可以合并数据后再写磁盘, 但这个目前还改不动
4. 硬件控制器: sdhci_send_command -> 写DMA数据以及寄存器(sdhci_prepare_data -> sdhci_writew) -> eMMC控制器
sdhci_irq -> mmc_request_done
|