| 研究生: |
詹凱程 Zhan, Kai-Cheng |
|---|---|
| 論文名稱: |
基於嵌入式Linux比較與評估I/O事件通知機制 Comparing and Evaluating I/O Event Notification Mechanisms Based on Embedded Linux |
| 指導教授: |
侯廷偉
Hou, Ting-Wei |
| 學位類別: |
碩士 Master |
| 系所名稱: |
工學院 - 工程科學系 Department of Engineering Science |
| 論文出版年: | 2021 |
| 畢業學年度: | 109 |
| 語文別: | 中文 |
| 論文頁數: | 40 |
| 中文關鍵詞: | 嵌入式Linux 、I/O Multiplexing 、Signal 、Timer |
| 外文關鍵詞: | Embedded Linux, I/O Multiplexing, Signal, Timer |
| 相關次數: | 點閱:254 下載:18 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
於嵌入式Linux系統,當週邊裝置發生硬體中斷時,底層驅動程式將會通知I/O事件至上層應用程式,由應用程式決定該如何對I/O事件進行後續的應用服務,故開發人員對於通知I/O事件之時間成本須有一定的掌握度,才能確保應用程式能即時對I/O事件進行處理。
本論文於NuMaker-IIoT-NUC980與NanoPi-M1等嵌入式開發板,針對Blocking I/O與Non-blocking I/O應用情境,使用I/O Multiplexing之系統呼叫select、poll與epoll,以及Signal等現有的I/O事件通知機制,量測各I/O事件通知機制從底層驅動程式之硬體中斷服務程序,通知I/O事件至上層應用程式之時間差,並將該時間差用於比較與評估I/O事件通知機制之效能與使用時機。
研究成果如下:I/O Multiplexing效能相較於Signal快,故若有較高即時性需求時,建議使用I/O Multiplexing。於Blocking I/O情境,poll適用於File descriptor數量為1的狀況,其餘狀況建議使用epoll。於Non-blocking I/O情境,poll適用於File descriptor數量小於等於2的狀況,其餘狀況建議使用epoll。於各情境,poll或epoll效能皆相較於select快,故不建議使用select。
In the embedded Linux system, when a hardware interrupt occurs in a peripheral device, the low-level driver will notify the I/O event to the high-level application. Therefore, the developers must know about the time cost of notifying I/O events to ensure that the application can handle I/O events in real-time.
The experiments of this thesis is implemented on the NuMaker-IIoT-NUC980 and NanoPi-M1 (embedded) development boards. We focus on situations of blocking I/O and non-blocking I/O, using the existing I/O event notification mechanisms, including Signal and I/O Multiplexing (select, poll, and epoll). The notification time, measured from the interrupt service routine of the low-level driver and the notification to the high-level application, is used to evaluate the performance and the timing of using each I/O event notification mechanism.
According to the evaluation results, the performance of I/O Multiplexing is better than Signal. If there is a higher real-time requirement, I/O Multiplexing is recommended. In situations of blocking I/O, poll applies to a condition that the number of file descriptors is one, epoll applies to the other conditions. In situations of non-blocking I/O, poll applies to a condition that the number of file descriptors is less than or equal to two, epoll applies to the other conditions. In each situation, both poll and epoll are better than select. Therefore, select is not recommended.
[1] Wikipedia, “Everything is a file”, Accessed on July 21, 2021. [Online] Available: https://en.wikipedia.org/wiki/Everything_is_a_file
[2] J. Corbet, A. Rubini, G. Kroah-Hartman, Linux Device Drivers, O’Reilly Media, 2005.
[3] Wikipedia, “epoll”, Accessed on July 21, 2021. [Online] Available: https://en.wikipedia.org/wiki/Epoll
[4] M. Kerrisk, “signal-safety(7) — Linux manual page”, Accessed on July 21, 2021. [Online]. Available: https://man7.org/linux/man-pages/man7/signal-safety.7.html
[5] O. Semeniuta, P. Falkman, “Event-driven industrial robot control architecture for the Adept V+ platform”, July 29, 2019. Accessed on July 21, 2021. [Online] Available: https://peerj.com/articles/cs-207/
[6] F. B. i Moriscot, Benchmarking Input/Output Multiplexing Facilities Of The Linux Kernel, Bachelor's thesis, Diposit Digital de la Universitat de Barcelona, Spain, 2019.
[7] L. Gammo, T. Brecht, A. Shukla, D. Pariag, “Comparing and Evaluating epoll, select, and poll Event Mechanisms,” Proceedings of 6th Annual Linux Symposium, 2004.
[8] S. Wang, H. Zhang, H.-Q. Tan, L.-Y. Jiang, “Implementation of Step Motor Control under Embedded Linux Based on S3C2440,” in International Conference on Future Energy, Environment, and Materials, pp. 1541-1546, 2012.
[9] B. Chen, K. Dong, “Driver Design and Implementation for Radar Data Acquisition System,” in IEEE 2015 8th International Symposium on Computational Intelligence and Design (ISCID), pp. 5-8, 2015.
[10] Nuvoton Technology Corporation, NuMaker NUC980 IIoT User Manual, 2020.
[11] FriendlyARM WiKi, “NanoPi M1”, Accessed on July 21, 2021. [Online] Available: https://wiki.friendlyarm.com/wiki/index.php/NanoPi_M1