+ All Categories
Home > Documents > New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간...

New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간...

Date post: 11-Oct-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
7
292 Journal of Korea Robotics Society (2012) 7(4):292-298 http ://dx . doi . org/ l0.7746/jkros.2012. 7.4 . 292 ISSN: 1975-6291 / eISSN: 2287-3961 On Benchmarking of Real-time Mechanisms in Various Periodic Tasks for Real-time Embedded Linux Koh J ae- Hwan 1 , Choi Byoung- Wook t A bstr act It is a real-time system that the system correctness depends not only on the correctness of the logical result of the computation but also on the result delivery time. Real-time Operating System (RTOS) is a software that manages the time of a microprocessor to ensure that the most important code runs first so that it is a good building block to design the real-time system. The real-time performance is achieved by using real-time mechanisms through data communication and synchronization of inter-task communication (ITe) between tasks. Therefore, test on the response time of real-time mechanisms is a good measure to predict the performance of real-time systems. This paper aims to analysis the response characteristics of real-time mechanisms in kernel space for real-time embedded Linux: RTAI and Xenomai. The performance eva luations of real-time mechanism depending on the changes of task periods are conducted. Test metrics are jitter of periodic tasks and response time of real-time mechanisms including semaphore, real-time FIFO, Mailbox and Message queue. The periodicity of tasks is relatively consistent for Xenomai but RTAI reveals smaller jitter as an average result. As for real-time mechanisms, semaphore and message transfer mechanism of Xenomai has a superior response to estimate deterministic real-time task execution. But real-time FIFO in RTAI shows faster response. The results are promising to estimate deterministic real-time task execution in implementing real-time systems using real-time embedded Linux. Keyw ords: Real-time embedded linux, IPC, Xenomai, RTAI , Real-time mechanism 1. E 1J A ln <fl IJ1'6}e:j L]10l1 g ?oj g '6h=- IJ1 '6 }O:j g L]1 0 F A1 AE il2. A i 01 %'6 }O:j A1 Received : Aug. 10. 2012; Reviewed: Oct. 8. 2012; Accepted : Nov. 8. 201 2 ,,' This study was fi nancially supported by Seoul National Uni versity of Sci ence and Technology Corresponding author: Electrical and Infonnation Engineering, Seoul Uni v. of Science and Technology, Gongneung-Dong, . ·owon-Gu. Seoul , Korea (bwchoi @seoultech.ac.kr) I Elecnical Engineering, Seoul National Uni v. of Sc ience and Technology (go3 16 @gmail.com) Copyrigh c KROS 1J A 1n +}:A-1,-,)lAJ o1 A1010 1.:iI. 01ul 1 r1 c p ,- c -, '---!. '0'-'" ' I -=-j ,"01-11 L--J- - 0 '- T Q.] ¥H:J 0]1 Ai :A 3 Q.] 01 q. :t1-2- 0l1 r1l Q.] 1J A 1 n A1 AE il2. 01 <?.J=% '6 } oOj 0 F '6 } A 1 Eil g T '6 } 71 '6 }oOj 1J A1n RTOS (Re al-Time Operating System) 7} °1%£1.:iI. A1 AE il 0l1 ,'t-°3 1J A 1n A1 AE il o 1 Ad '; g * '6 } e:j 011 a=j % g 711 .'f:l q. uj- c.}-" i 1J A 1 n A 1 A Eil 01 .B.. 71 '(l g 011 IJ1 '6 } O:j ul 2.l 7- 3 A1n 0l1 g 7-J'6 }71 1J A 1n Journal of Kor ea Robotics Society (2012) 7(4) :292-298 292 ISSN : 1975-6291 / eISSN: 2287-3961 On Benchmarking of Real-time Mechanisms in Various Periodic Tasks for Real-time Embedded Linux Koh Jae-Hwan\ Choi Byoung-Wook t Abstract It is a real-time system that the system correctness depends not only on the correctness of the logical result of the computation but also on the result delivery time. Real-time Operating System (RTOS) is a software that manages the time of a microprocessor to ensure that the most important code runs first so that it is a good building block to design the real-time system. The real-time performance is achieved by using real-time mechanisms through data communication and synchronization of inter-task communication (ITC) between tasks. Therefore , test on the response time of real-time mechanisms is a good measure to predict the performance of real-time systems. This paper aims to analysis the response characteristics of real-time mechani sms in kernel space for real-time embedded Linux: RTAI and Xenomai. The performance evaluatio ns of real-time mechanism depending on the changes of task periods are conducted. Test metrics are jitter of periodic tasks and response time of real-time mechanisms including semaphore , real-time FIFO , Mailbox and Message queue. The periodicity of tasks is relatively consistent for Xenomai but RTAI reveals smaller jitter as an average resul t. As for real-time mechanisms, semaphore and message transfer mechanism of Xenomai has a superior response to estimate deterministic real-time task execution. But real-time FIFO in RTAI shows faster response. The results are promising to estimate deterministic real-time task execution in implementing real-time systems using real-time embedded Linux. Keywords: Real - time embedded l inux. IPC , Xenomai , RTAI , Real-t i me mechanism R eceived : Au g. 10. 2 01 2; Reviewed: Oct. 8. 2 012; Acce pted: Nov. 8. 2012 This study was financi a lly s upported by Seo ul Nationa1 Unive rsi ty of S cience and Techno logy Corresponding a uthor: E lec trical and Inf o rmat ion E ngine ering, Seo ul U ni v. of Science and T echnol ogy, Go ngne ung -Dong , Seoul, Korea (bw choi @ seoultech.ac. kr) 1 Seo ul Nati onal U ni v. of Sc ien ce and Technol ogy Co pyright@KROS RTOS (Real-Time Operating System)
Transcript
Page 1: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

292 Journal of Korea Robotics Society (2012) 7(4):292-298 http://dx.doi.org/ l0.7746/jkros.2012.7.4.292 ISSN: 1975-6291 / eISSN: 2287-3961

AJA1~ ~lJllL1=- ~~~011~~ q0J=~ ~71~ Et~3-~

l1Al~ ufl7-lY~ ~J~ ~~

On Benchmarking of Real-time Mechanisms in Various

Periodic Tasks for Real-time Embedded Linux

Koh J ae-Hwan1, Choi Byoung-Wook t

Abstract It is a real-time system that the system correctness depends not only on the correctness of the logical result of the computation but also on the result delivery time. Real-time Operating System (RTOS) is a software that manages the time of a microprocessor to ensure that the most important code runs first so that it is a good building block to design the real-time system. The real-time performance is achieved by using real-time mechanisms through data communication and synchronization of inter-task communication (ITe) between tasks. Therefore, test on the response time of real-time mechanisms is a good measure to predict the performance of real-time systems. This paper aims to analysis the response characteristics of real-time mechanisms in kernel space for real-time embedded Linux: RTAI and Xenomai. The performance evaluations of real-time mechanism depending on the changes of task periods are conducted. Test metrics are jitter of periodic tasks and response time of real-time mechanisms including semaphore, real-time FIFO, Mailbox and Message queue. The periodicity of tasks is relatively consistent for Xenomai but RTAI reveals smaller jitter as an average result. As for real-time mechanisms, semaphore and message transfer mechanism of Xenomai has a superior response to estimate deterministic real-time task execution. But real-time FIFO in RTAI shows faster response. The results are promising to estimate deterministic real-time task execution in implementing real-time systems using real-time embedded Linux.

Keywords: Real-time embedded linux, IPC, Xenomai, RTAI , Real-time mechanism

1. A~ E

1JAln Al~Eil2. Al ~EilQ.] :A3~Ad J!} ~7Jl1 ~Jf- <fl ~ 0l1 IJ1'6}e:j .<f:l. '6}~ A1 n~ A~l~ L]10l1 ~ g g ~~ ~ ?oj g ~~ ~LlloF '6h=- Al~Eilo1q. ~ cj1 ~£1A1 'Bi~

~Jf- A}~Oll IJ1 '6}O:j A1 n~~~ cj1 ~ 7pg-~ ~~ g ~~~ L]1 0F ~q. ~llllq£ A1AEil2. p}ol 3.~n:~A~l

Ai ~ 01 %'6}O:j =;:Ad~ ~~ Q.] '6}£~~1~ ~ A~l~'6}~ A1

Received : Aug. 10. 2012; Reviewed: Oct. 8. 2012; Accepted : Nov. 8. 2012 ,,' This study was financially supported by Seoul National University of

Science and Technology

Corresponding author: Electrical and Infonnation Engineering, Seoul ~ational Univ. of Science and Technology, Gongneung-Dong, . ·owon-Gu. Seoul, Korea ([email protected])

I Elecnical Engineering, Seoul National Univ. of Science and Technology (go316 @gmail.com)

Copyrigh c KROS

~Eil~ qOJ~ ~oFo]Vi ~%£1.:iI. ~q. 1JA1n A1 ~

E~LQ.. A1 ?}:A~ +}:A-1,-,)lAJo1 A10101.:iI. 01ul1r1 c A1 AE~1 .Q.. p ,- c -, '---!. '0'-'" ' I -=-j o~ ,"01-11 L--J- - 0 '-

T ~ Q.] ¥H:J 0]1 Ai :A3 Q.] 01 q . :t1-2-0l1 ~Ai r1l Jf-~ Q.] 1J A 1 n A1AEil2. ~llllq£ A1AEil~ T~£1.:iI. ~~9 , 01 c~ ~ 01%~ ~ l:Ij1q£ A1~Eil Q.] ,'t-°3~11 A~1 ~Ai A1 n~

A~l <?.J=% ~~ '6}oOj 0 F '6} ~ A 1 ~ Eil g T ~ '6} 71 ~ '6}oOj 1J A1n ,'t-°3~11 A~1 '(l RTOS(Real-Time Operating System)

7} °1%£1.:iI. ~Jq.

~~~~ ~l:Ij1q£ A1AEil 0l1 A}%£1~ ~% ,'t-°3 ~11 A~1 ~ 1JA1n A1AEilo1 .B..-T'6}~ Ad '; g ~7-J'6}A1 * '6}e:j A~l ~ 011 ~ a=j % g ~ 711 .'f:l q . uj-c.}-"i 1J A 1 n A 1 A Eil 01 .B.. T'6}~ l:lj-'~· 71 ~ '(l ~ g 011 IJ1 '6}O:j ul2.l 7-3 "5B ~ A1n 0l1 cj1 ~ 7pg-~ l:lJ~~~ ~SFd ~~ ~~ g ~ 7-J'6}71 ~"5B RTOS ~ -,,}%~q. 1JA1n ,'t-°J;(11 A~1 ~ ~

Journal of Korea Robotics Society (2012) 7(4) :292-298 292 http :νdx.doi . org/l 0 . 7746/jkros.2012 . 7 .4 .292 ISSN: 1975-6291 / eISSN: 2287-3961

실시간 임베디드 리녹스에서 다양한 주기적 타스크의

실시간 메커니즘 성능 분석

On Benchmarking of Real-time Mechanisms in Various

Periodic Tasks for Real-time Embedded Linux

고 재 환 최 병 욱f

Koh Jae-Hwan\ Choi Byoung-Wook t

Abstract It is a real-time system that the system correctness depends not only on the correctness of the logical result of the computation but also on the result delivery time. Real-time Operating System (RTOS) is a software that manages the time of a microprocessor to ensure that the most important code runs first so that it is a good building block to design the real-time system. The real-time performance is achieved by using real-time mechanisms through data communication and synchronization of inter-task communication (ITC) between tasks. Therefore , test on the response time of real-time mechanisms is a good measure to predict the performance of real-time systems. This paper aims to analysis the response characteristics of real-time mechanisms in kernel space for real-time embedded Linux: RTAI and Xenomai. The performance evaluations of real-time mechanism depending on the changes of task periods are conducted. Test metrics are jitter of periodic tasks and response time of real-time mechanisms including semaphore, real-time FIFO, Mailbox and Message queue. The periodicity of tasks is relatively consistent for Xenomai but RTAI reveals smaller jitter as an average result. As for real-time mechanisms, semaphore and message transfer mechanism of Xenomai has a superior response to estimate deterministic real-time task execution. But real-time FIFO in RTAI shows faster response. The results are promising to estimate deterministic real-time task execution in implementing real-time systems using real-time embedded Linux.

Keywords: Real- time embedded linux. IPC , Xenomai, RTAI , Real-time mechanism

1. 서 론

실시간 시스템은 시스템의 정확성과 함께 외부 입

력에 대하여 원하는 시간적 제한 내에 반응을 위한 출

력을 만들어내야 하는 시스템이다. 즉 예측되지 않는

외부 자극에 대하여 시간적으로 예측 가능한 출력을

만들어 내야 한다. 임베디드 시스템은 마이크로프로세

서를 이용하여 특정한 목적의 하드웨어를 제어하는 시

Received : Aug. 10. 2012; Reviewed: Oct. 8. 2012; Accepted: Nov. 8. 2012 징 This study was financially supported by Seoul Nationa1 University of

Science and Technology Corresponding author: Electrical and Information Engineering, Seoul ~ational Univ. of Science and Technology, Gongneung-Dong, ~owon-Gu. Seoul, Korea ([email protected])

1 Elec미cal En멀ne얻ing, Seoul National Univ. of Science and Technology (go3167@맺ail.com)

Copyright@KROS

스템으로 다양한 분야에서 활용되고 있다. 실시간 시스

템은 시간적 관점에서의 정의이고, 임베디드 시스템은

구현의 관점에서 정의이다. 최근에 와서 대부분의 실시

간 시스템은 임베디드 시스템으로 구현되고 있으며 , 이

러한 이유로 임베디드 시스템의 운영체제로서 시간적

제믿t을 만족하여야 하는 시스템을 구현하기 위하여 실

시 간 운영 체 제 인 RTOS(Real-Time Operating System)

가 이용되고 있다

일반적으로 임베디드 시스템에 사용되는 범용 운영

체제는 실시간 시스템이 요구하는 성능을 보장하지 못

하여 제어에 어려움을 겪게 된다. 따라서 실시간 시스

템이 요구하는 비동기적인 반응에 대하여 미리 정해진

시간에 예측 가능한 방법으로 신뢰성 있는 출력을 보

장하기 위해 RTOS를 사용한다 실시간 운영체제는 임

Page 2: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

B11 q.'::- -&o(l~~1 A~1 -i"-011 Ai AI n g A~1 O-j ~ 4- ~ ~ 71 '0 01 ±W-B -&°8~~I A~I£ AJ% RTOSS4- ~~ ::~::/-£ ~"8"~

-i"-<:j ~Aln <?:lB11q .'::- ~~~£ T~ AI g 4- ~q[1-41.

AJ% RTOS ~ ~~~ Aj'Q, ~~17-l1:§:j-~ 7~~ ~7cl ::L~

jl ~~17-l1 ~<:j 71~ A1 Sf:! ~ 2l ;<J~O I ~Al~ -=;;<j -&°8 ~~I A~I£2l 71 ~ ~~01 ~ 4- ~.2..9 jl7}9.1 3::71 7~~

1::l1% ~ 7~~9.1 *~Ajol ~~~q.c B~ g ?!-~qr51.

01011 1::l1"3"}O:j .2..~ ~~£ 7~~-B -&°8~~IA~I~ q0J:~

"3"} .'::-~~IO-j AI Sf:! JIj- W7J11 Aj '0 s: 4'-4-"3"}O:j t'i-~ AI ~ Eil011 ~.%~jl ~qr6-91. 0 l cl~ RTOS ~ 01%~ ~Aln AI

~Eil~ ~ E.}~3.£ T~~9 ~Aln uJl~Y~ g 01 %"3"}O:j E.}A3. n %~JIj- %71:§:j- ::L~jl A}Sf:!¥!-t:q7} 01~O-j~qrlOl. uJ-i'!-}Ai ~Aln A1A~2l Aj'o ~ ~Aln

~I~ '~~ ~ ?,yJJ-f:~ <-ro Q;;' 'Jr-'2r~ ~ '3,t~ 11 ~JI

Al ~Eil9.1 Aj'o g .1J!.;<J"3"}71 ~~ ~Aln uJl71 Y~9.1

Aln~ Aj'o ~~ ~ U~4'- -i"-Jl~ ~~ ~oFolq. AJ% RTOS ~ ~Aln uJl71Y~2l A <:~ Aa'o ~01 ~~17-l1

~.2..£ 01~~A1 Jl ~Al~ ~~ SA<:j ~Aln <?:lB11q .'::- ~~~~ 01S4- ~~ AJ'o ~Ol UI1::l1 ~ ~;<jolq.

~AH ~Aln <?:lB1]qr:: 2-l~A9.1 Aj'o -If-~011 Lll~

~T£ Al ~Eil9.1 AjlO-j Aa'o:;.:J- <:jEj~ E ~1 ~011 Lll~

Al ~9.1 ¥!-1:l011 Ai ~~~ ~.::!.7~ ~li~~jl, .!£~ {l"8"~

~T£Ml ~~ ~A ll?~E<:j RTAIS4- Xenomai ~

01%"3"}O:j %~ T71 E}~o!lAi9.1 ~Aln uJl~Y~011

Lll"3"}O:j Aln~ Aj 'o ~g ¢.~"3"})1qrl1 -131. ~ ~~

011Ai~ {l"8"~ ~T~# B}%C 5O E.}~3.9.1 T717} ~

:§:j-~ 7cl4'-011 ~Aln uJl~Ll~9l A]n~ Aj '0 g ~~~ q. Lll-¥--lf-9.1 ~Aln Al~%ol Ai Al-%~ ~ ~Aln E.}~

3.7} T71 ~<:j -=; Aj g ?t~q.c ~01jAi q0J:~ T71011

Ai9.1 ~Aln uJl71Y~ 2l Aa'o ~:§:j-011 Lll~ ~T7} ~

Jl"3"}r:}. ~ ~T~ ~Aln Al~~ g T~"3"}7 1 ~'5H q 0J:~ "T-719.1 ~ Al n E}~2 ~ -+~ "3"}O:j 0 F ~q.c ~ 011 Ai ~1 g Als: ~ ~ u~4'- R § ~ ~JJ}°l q. 1- ,(, ~JJ}

011 uJ-;:: ~~ ~A ~ g 4-~~q~ ~~2l ~Aln uJl71y~ g 7}Al ~ ~Aln <?:lB1]q.'::- 2-l~~ T~ol 7}

'o~ ;;;!~ 71t11 ~q.

~ ~~9.1 TAj ~ ct%JIj- ~q. zlAi 2;<J01jAi ~

~~01jAi T~~ ~Aln <?:lB11q.'::- ~~A2l ~ifl ~7cl

~ l:lJ~ g nE:f"3"}711 Ai~"3"}Jl, 3;<J011 Ai ~ ~Aln Al~ Eil9.1 71~01 ~ ~ ~Aln E.}~3.9.1 "T-71Aj g ~"3"}9, 4;<J011Ai~ {JA1Zl- uJl71 Y -;- 9.1 Aln~ Aj '0 ° 1 E.}A 3.9.1

RTAIS4- Xenomai~ ~Aln -&°8~~lA~17} or\:! ~Al

n E.}A==7 ~ ~~ <:jE11t1101Aq. uJ-i'!-}Ai RTAlt-l­Xenomai ~ A}%"3"}71 5f-1 '5~Ai ~ -&°8 ~~I A~1 7} ~.B.."3"}q.

~ t:~011 Ai ~ ~~Aj ~.:£S4- ~iflg %"3"}O:j 0}c]1S4-

~~ 7~~ ~7cl011Al £,]~ ~~~ 7l~ g ~%"3"}O:j

RTAIS4- Xenomai ~ T~"3"}~L}. A}).-11~ T~ JIj-;<j ~ {l"8"~ ~T011Ai q~qr131 .

• Ubuntu 10.04 LTS • Intel Core2 Duo CPU E8400 @ 3.00GHz • Linux Kernel 2.6.32.11

• gcc-4.4.3

~ ~ifl~ 71~ .:g-n011 Ai ll£::L~g -3}Aj"3"}~jl,

~ifl2l %ojAj g 5f-1"3"}O:j .2.~ T:::i:~ °1%"3"}O:j T~"3"}

)1q. ::L~jl .2.~ Aj'o ~~ ~ ~~ uJ1 A1Al ~'I ~

01%"3"}oj 4-"8"~ + ~<:j"3"H=- ~j.~ 71 ~q. uJ-i'!-}Ai L-11 ° 1 E1 ~1 ~ 011 uJ- ;:: AI ~ Al n g l:lB:~~1 "3"})1 q. .!£ ~ A 711 ~?8011 9.1~ Al~ g l:lJA1"3"}71 -'fl "3"}O:j "5J-AJ "3"}t-l-2l .2.

% g 711@. 011 T% i>}oj ~ ~ i>}~ q . ::L Cl t-l- 01 S4- ~o 1 ~ "8"~ "3"}oj s: ~ ~~ 011 71 ~~ ~ %-3}"3"} ~ II £).-11 A 7}

E-A~ "3"}7 1 n:J1~011 Aj '0 9.1 1::l1.iiL~ }Ij-Q{~ 4- ~s:~ 50 Jti9.1 ~ifl g ~~i>}~q. ~Aln uJl71Y~~9.1 4-"8"~Al

n ~Aj~ zrzr RTos ~ol A-11 .:g-'5~ "T-~ API~ °1%"3"} oj Al n g ~ Aj "3"}'?j q.

~ ~~011 Ai ~ t11li~<:j ~Al n ~B11q .'::- ~~~<:j

RTAIS4- Xenomai ~ IPC(Inter Process Communication) ¥!-1:l011Ai Aln~ Aj'o -If-~ ~L}. Aj'o ~~~ ~Aln Al~Eil T~2l 71~01 ~ ~ ~Aln EtA3.9.1 "T-7jAj g ~~i>}Jl, ~Aln uJl71Y~~ E.}A3. n %71:§:j-S4- % ~011 7};<J l'J-0l Al-%~ ~ ).~lp}±~(Semaphore), ~Al

n FIFO(First-In First Out), uJl ~~A(Mailbox) ~ uJl A1Al-Tt(Message Queue)2l Al n~ Aj'o g ~~~q. ~

~~011 Ai 4-"8"~ ~ {J Al Z1- uJl ~ Y -;- 9.1 A 1 Zl-~ Aj '0 ~~

실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 메커니즘 성능 분석 293

영~“-

베디드 운영체제 중에서 시간을 제어할 수 있는 기능

이 포함된 운영체제로 상용 RTOS와 오픈 소스로 진행

중인 실시간 임베디드 리늑스로 구분 지을 수 있디11-4]

상용 RTOS는 검증된 성능 체계화된 개발 환경 그리

고 체계적인 기술 지원 등의 장점이 있지만 특정 운영

체제로의 기술 종속이 될 수 있으며 고가의 초기 개발

비용 및 개발의 유연성이 떨어진다는 단점을 갖는다15]

이에 비하여 오픈 소스로 개발된 운영체제는 다양한

하드웨어 지원과 함께 성능도 우수하여 많은 시스템에

적용되고 있다16-9] 이러한 RTOS를 이용한 실시간 시

스템은 다중 타스크로 구현되며 실시간 메커니즘을 이

용하여 타스크 간 통신과 동기화 그리고 자원관리가

이루어진다1 1 0] 따라서 실시간 시스템의 성능은 실시간

쾌|커나좀악 사칸적 성능으료 냐타낼 수 있]1, 돼문섹l

시스템의 성능을 보장하기 위하여 실시간 메커니즘의

시간적 성능 분석은 매우 중요한 연구 분야이다. 상용

RTOS는 실시간 메커니즘의 시간적 성능 분석이 체계

적으로 이루어지고 있지만 오픈 소스인 실시간 임베디

드 리녹스는 이와 같은 성능 분석이 미비한 실정이다.

현재 실시간 엄베디드 벽늑스의 성능 분석에 대한

연구로 시스템의 제어 성능과 인터럽트 처리에 대한

지연의 관점에서 진행된 연그카 발표되었고, 또한 선행

연구로써 오픈 소스 프로젝트인 RTAI와 Xenomai를

이용하여 동일 주기 타스크에서의 실시간 메커니즘에

대하여 시간적 성능 분석을 수행하였다111-13] 본 논문

에서는 선행 연구결과를 바당으로 타스크의 주기가 변

화할 경우에 실시간 메커니즘의 시간적 성능을 분석한

다. 대부분의 실시간 시스탬이l서 사용되는 실시간 타스

크가 주기적인 특성을 갖는다는 점에서 다양한 주기에

서의 실시간 메커니즘의 성능 변화에 대한 연구가 필

요하다. 본 연구는 실시간 시스템을 구현하기 위해 다

양한 주기의 실시간 타스크를 구현하여야 한다는 점에

서 처음 시도 되는 매우 유용한 결과이다 추후, 결과

에 따른 오픈 소스 분석을 수행한다면 최적의 실시간

메커니즘을 가지는 실시간 임베디드 리늑스 구현이 가

능할 것으로 기대된다

본 논문의 구성은 다음과 같다. 먼저 2장에서 본

논문에서 구현한 실시간 임베디드 리녹스의 실험 환경

및 방법을 간략하게 서술하고, 3장에서는 실시간 시스

템의 기본이 되는 실시간 타스크의 주기성을 분석하며,

4장에서는 실시간 메커니즘의 시간적 성능이 타스크의

쨌썼@쨌쨌X

주기에 따라 어떻게 변화되는지를 살펴본다 그리고 5

장에서 결론을 맺는다.

2_ 실시간 임베디드 리녹스 구현

RTAI와 Xenomai는 실시간 운영체제가 아닌 실시

간 타스크를 위한 인터페이스다. 따라서 RTAIY­Xenomai를 사용하기 위해서는 운영체제가 펼요하다.

본 논문에서는 호환성 검토와 실험을 통하여 아래와

같은 개발 환경에서 최신 리녹스 커널을 활용하여

RTAI와 Xenomai를 구현하였다. 자세한 구현 과정은

선행 연구에서 다뤘디11 3]

• Ubuntu 10.04 LTS

• Intel Core2 Duo CPU E8400 @ 3.00GHz

• Linux Kemel 2.6.32.1 1

• gcc-4 .4.3

본 실험은 커널 공간에서 프로그램을 작성하였고,

실험의 용이성을 위하여 모률 구조를 이용하여 구현하

였다. 그리고 모든 성능 분석은 커널 메시지 함수를

이용하여 수행 후 확인하는 절차를 거쳤다. 따라서 데

이터 처리에 따른 지연 시간을 배제하였다. 또한 스케

줄렁에 의한 지연을 방지하기 위하여 항상 하나의 모

률을 커널에 구동하여 실험하였다. 그러나 이와 같이

진행하여도 리녹스에 기본적으로 동작하는 프로세스가

존재하기 때문에 성능의 비교를 파악할 수 있도록 50

번의 실험을 반복하였다. 실시간 메커니즘들의 수행시

간 측정은 각각 RTOS들이 제공해주는 API를 이용하

여 시간을 측정하였다.

3. 주기적 타스크의 주기성 연구

본 논문에서는 대표적인 실시간 임베디드 리녹스인

RTAI와 Xenomai를 IPC(Inter Process Communication)

관점에서 시간적 성능 분석 한다 성능 분석은 실시간

시스템 구현의 기본이 되는 실시간 타스크의 주기성을

분석하고, 실시간 메커니즘으로 타스크 간 동기화와 통

신에 가장 많이 사용되는 세마포어(Semaphore ), 실시

간 FIFO(First-In First Out) , 메일박스(Mailbox) 및 메

시지큐(Message Queue)의 시간적 성능을 분석한다. 본

논문에서 수행한 실시간 메커니즘의 시간적 성능 분석

Page 3: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

~ AJ-% RTOS ~ ~-2-oJj 7R~~ uc/os-m.Qj "'-J '0 ~ "'-1 loll-Al.,.,] £Ol il"l- loll-Alo;:::> ¢:.i5Uc 1<>l ,..-l f14] , 0,"'" 0 2,-, O,~ I ~-'1M'-I .

~Aj Zl- Al ~Eil~ q.0J~ 2f-7 j£. .:r-~~o:j ~1fr~~

RTOS .Qj 784- lO[ms) ~ 7j~~ il}~ ojoJj AJ"T l:lH

.Qj 2f-7j£. ~AjZl- Ej-A3~ .:r-~~q.. uJ-2.}Ai ~ ~~

oJj Ai~ Ej-~3.Qj 2f-7j oJj uJ-~ ~AjZl- uij7'-]Y~.Qj "'-J'o

7<}01 ~ )i.7j ~i5l1 Ej-~39l 2f-7j ~ lO[ms) , 30[ms],

50[ms]£. ~7Jil}u:j ~AjZl- u1j 7'-]Y~.Qj g 1ft AjZl-~ :;­

Aclil}'?jq.. Ej-~3.Qj 2f-7 j7} ~78~O-]s:. ~~ .:r-~~ % ~ il}q.. Fig. 1 ~ ~~~j ~ ~ .:r-~ ~ Zl-Et:§:} il}~ ::J.. '6 .QS. Y. Ej- 't!l -3l oj q..

Fig. 2~ Periodic Task.Qj ~~ .:r-~~ .QjA}.::rr.:r=.£.

If.. ~ il}'?j q.. Ej-~37} 7<~ g ~ i5~ ~ l?1 ~ ilH=- 2f-7j ~ "'-J Acl il}.:iL Ej-~37} 2f-7j ~.QS. ~ i5~ ~ 71j ~ ~ q. ::J.. t:}%

z.rz.r~ ~Ajn ~U1jq.:r=. ~~~7} A~j-ttil}~ API ~ oj

%il}~ Ej-~37} 7<1 g ~Acl~ 97joJj Acl~ilj ~i5~~~

Aj )i.7j ~ilH "'-1 Zl-~ :;-Acl~q. z.rz.r~ 97joJj ~~

~~ ~3!j-~ Fig. 3~59} ;Q-q.

Fig. 3~5oJj y.Ej-\:!- ~~ z.rz.r~ 2f-71oJVi ~A~j

Ej-~3~ 2f-7VJ~ .2.7<}oJj t:J1~ ~3!j-ojq. ~3!j-~ [ns)

£. y.Ej-t.H~q. 50[ms)97 joJVi Xenomai~ :i\3it~.QS.

±8269[ns)~ .2.7<}7} ;i.:iL, RTAI~ 784- ±15878[ns) ~

]I[ OR ]I Xenomai RTAI

Message queue Mailbox

Fig. 1. Task diagram of testing real -time performance

void TasklO (

}

set period and make periodic;

.vhile(l ) {

}

start time measurement; wait period; stop time measurement;

Fig. 2. Pseudocode for testing periodic task

Periodic Task_lOms

Averag~

~=====:'~~IiIIIIiIIIIiIII. 41092 Worst

21021

10 Best

£cf¥! : Ins]

Fig. 3. Experimental result of task of period 10ms

PeriodicTask_30ms

• XenomaL30ms • RTAI_30ms

__ . n007 Av~rllge pill

10~62

~==========~.29i84.8 .......... Worst 62447

Best 7S

8¥! ' Ins]

Fig. 4. Experimental result of task of period 30ms

Periodic Task_SOms

i

===~8;26~9 _ Average 15878

==;;iiiiiiiiiiiiii===:Z;:42426 Worst 38890

21 Best

64 £I~ : [ns]

Fig. 5. Experimental result of task of period 50ms

.2.7<}7} ~A~il}'?jq. 30[ms] 2f-7 joJVi ~ RTAIst

Xenomai.Qj .2.7<}~ :i\3it°j tlj;:il}71j y.Ej-;i.:iL lO[ms]

97joJVi ~ 50[ms)Q}~ ~~ RTAI7} XenomaioJj tljilH

.2.7<}.Qj :iIa1NJ:oj 2l:lH 7}7J}O] ~o-].:r=.~ .2..~ ~ ~ "T ~q. ~ Ej-A 3.Qj 9 7 j7} fJ-~-IS RTAI7} Xenomai

oJj tI]ilH Acl~~ AjZl-oJj Ej-~37} ~i5]~~.:iL 97j7}

~-I S Xenomai7} RTAl oJj tljilH Acl~~ A1Zl-oJj Ej-~

37} ~ i5]~~q . .r£.~ RTAI9l 784- Ej-~3.Qj 2f-7 j7}

{}~ ~ "T-S- .2.7<}7} ~Al il}71j ~o-].:r=.~ .2..~ ~ ~ "T ~q.

294 트콧학화 논문지 제7권 제4호 (2012. 12)

은 상용 RTOS 및 최근에 개발된 uC/OS-III의 성능 분

석 방식과 동일한 방식으로 수행되었다114]

실시간 시스템은 다양한 주기로 구현되며 일반적인

RTOS의 경우 10[ms]를 기본으로 하여 이에 정수 배

의 주기로 실시간 타스크를 구현한다. 따라서 본 논문

에서는 타스크의 주기에 따른 실시간 메커니즘의 성능

차이를 보기 위해 타스크의 주기를 10[ms] , 30[ms],

50[ms]로 변경하며 실시간 메커니즘의 응답 시간을 측

정하였다. 타스크의 주기가 변경되어도 실험 구조는 동

일하다. Fig. 1 은 전체 실험 구조를 간략화 하여 그림

으로 나타낸 것이다.

Fig. 2는 Periodic Task의 실험 구조를 의사코드로

표현하였다. 타스크가 처음 실행되면 원하는 주기를 설

정하고 타스크가 주기적으로 실행되게 만든다. 그 디음

각각의 실시간 임베디드 리녹스가 제공하는 API를 이

용하여 타스크가 처음 설정한 주기에 정확히 실행되는

지 보기 위해 시간을 측정한다. 각각의 주기에 대한

실험 결과는 Fig. 3~5와 같다.

Fig. 3~5에 나타난 결과는 각각의 주기에서 실제

타스크의 주기성의 오차에 대한 결과이다. 결과는 [ns]

로 나타내었다. 50[ms]주기에서 Xenomai는 평균적으로

土8269[ns]의 오차가 났고, RTAI의 경우 土15878[ns] 의

Xenomai RT.에

Message queue Mailbox

Fig. 1. Task diagram 01 testing real-time perlormance

void Task1 0 f -E

­d % P

縮써ω 微

쨌 …

싸써

‘,‘,‘‘

}

總總

總4鋼總찌깐織

” -따 P.‘

mω 뺑 *싸

i’iJ

Fig. 2. Pseudocode lor testing periodic task

Periodic Task 10ms

_ Xe: n。π、a Î 10ms _ RTA I 10ms

6485

3554

Worst

Best

41092

21021

10

단위 [ns]

Fig. 3. Experimental result 01 task 01 period 10ms

PeriodicTask 30ms

• Xe nomai 30ms • RTA I 30ms

Averllge

29848

11007

10662

Worst. 62447

Best 7S

단와 [nsj

Fig. 4. Experimental result 01 task 01 period 30ms

PeriodicTask SOms

I Xenon、.i 50ms I RTAI 50ms

8269

15878

42426

38890

딘워 [n5]

Fig. 5. Experimental result 01 task 01 period 50ms

오차가 발생하였다 30[ms] 주기에서는 RTAI와

Xenomai의 오차의 평균이 비슷하게 나타났고 10[ms]

주기에서는 50[ms]와는 달리 RTAI가 Xenomai에 비해

오차의 평균값이 2배 가까이 줄어드는 모습을 볼 수

있다. 즉 타스크의 주기가 짧을수록 RTAI가 Xenomai

에 비해 정확한 시간에 타스크가 실행되었고 주기가

길수록 Xenomai가 RTAI에 비 해 정 확한 시간에 타스

크가 실행되었다. 또한 RTAI의 경우 타스크의 주기가

감소 할 수록 오차가 현저하게 줄어드는 모습을 볼 수

있다.

Page 4: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

4.1 AiIO~~OHSemaphore)

Fig. 6~ A11p}~e>i9.J A1Z!-~ Ad'; ~~~ !fl~ 9.J

-"}2~01q. Taskl 01 A11p}~e>i ~ 0Js:.~ -"11l-¥-si

Task27} A11p}~e>i~ ~=;~ -"11l lJ}A1 ~ttl A1Zl-% -:;

Adcs-}<;Jq. -:;, Taskl 01 A11p}~e>i ~ 0Js:.cs-}.Jl Task2£

Context Switch7} ~e>iy..Jl Task27} A11p}~e>i ~ ~ =;

CS-}71lJ}A1 ~ttl A1Z!-~ -:;AJcs-}C9 ~~ Fig. 7- 9011 y.

E}~9:tq.

1J~ ~~ ~Itj.!il..~ Xenomai7} A11p}~e>i ~ 0Js:.

cs-}.Jl q ;:: E}~3.7} °1~ ~=;CS-}-C1:11 ~~~ A1Z!-°1

void Taskl O {

set period and make periodic;

while(l) {

void Task20 (

while(J) { get semaphore;

release semaphare; stop rime measurement; start time measurement; }

} } }

Average

Worst

Sest

Worst

Best

Fig. 6. Pseudocode for testing semaphore

Semaphore_lOms

-=====.1.11 • 1426

~iiiiiiiiiiiiiiiiii~-' .23.5i3 ..... 3264

=====~1ii030 1278 I 8 Jf1: [nsj

Fig. 7. Result of semaphore of period 10ms

Semaphore_30ms

• XenomaL30ms • RTA.C30ms

~::::::::::::::::=~.23.15""1II 3226

=====.1.026 1277

8 Jf1 - [nsj

Fig. 8. Result of semaphore of period 30ms

Semaphore_SOms

• Xenomai • RTAI

1==========~.14.16". Ave rafe 2034

~====:::::::::::::::'2.2«"" Worst 2942

Best 1300 ~:=::.lOi27

e~ : [ns)

Fig. 9. Result of semaphore of period 50ms

.2.~ T71011-"i RTAI.!il..q fJ-l-l1 ~Jl.~ ~ .2.~ ~ ~ y

:uq. !E~ RTAI9.J 7cl~ T717} fJ-~-Isq Fig. 69.J :i!}

AJ ~ y-&-ECS-}-C1:11 ~~ ~ A1Z!-01 {}~CS-}<;Jq. 1JA1Z!- A1

A E-ij ~ -T ~ W 7cl ~ Xenomai 9.J Semaphore ~ 01 % w 7cl~ .2.~ T7101Vi RTAI.!il..q ~y~ A1 zr~ g It ~ Ad~ ~ ~ y:uq.

4.2 {sJAIl! FIFO Fig. lO ~ 7'[email protected]'-Z!-9.J Taskl 01 1JA1Z!- FIFO~ ~

cs-}C9 -"}%A} i'-Z!-9.J E}~3.£ 1:1101Si ~ 11~CS-}.Jl qA1

-"}%A} i'-zro1Vi 7'll@. i'-zr9.J E}~3.£ 1:11 ° 1 si ~ 11 ~

cs-}-C -T5:~ 9.J-"}2~£ y.E}~9:tq. 1J~ ~ !fl9.J ~~

9.J :i!}AJ ~ Y -&-E cs-}-C 1:11 ~ ttl A 1 zr ~ -:; Ad cs-}<;J q. FIFO

~ ~~719} M71 ~ .2.~ A1-'f:!cs-}-c .2.~£ -,,}%01 ~7}

';cs-}C9 oJ1:lJ--8-J A}li 11%~ !fli>R ~ 7R9.J FIFO ~ -"}

%cs-}<;Jq. Xenomai9.J 7cl~ FIF07} u11 A1A1 lI}°1~

(Message Pipe)£ AJ 9.J ~ e>i ~ q. 1J ~ ~:i!}~ Fig.

11 ~l3:i!} ~q.

1J~ ~~ .!il..~ E}A3.9.J 2f'-717} ~o}~-Isq

RTAI9} Xenomai .2.~ y-&-EA1z!-°1 {}~CS-}<;Jq. !E~

.2.~ T71011 -"i RTAI7} A11 i'-cs-}~ 1JA1Z!- FIF07}

Kernel Space

void Taskl O {

set period and make periodic;

while(]) ( put data to FIFO] ; start lime measurement; get data from FIF02; stop time measurement;

/

USei' Space

void mainO (

while(1) {

} }

get data from FIFO] ; put data to FIF02;

Fig. 10. Pseudocode for testing real-time FIFO

실시간 임베디드 리늑스에서 다양한 주기적 타스크의 실시간 메커니즘 성능 분석 295 -Semaphore_50ms

. X~n。π'\ði _RTA’

2942

2034

1027

130。

단위 : [n, ’

Fig. 9. Result of semaphore of period 50ms

모든 주기에서 RTAI보다 짧게 소요되는 모습을 볼 수

있다. 또한 RTAI의 경우 주기가 짧을수록 Fig. 6의 과

정을 수행하는데 걸리는 시간이 감소하였다. 실시간 시

스템을 구현 할 경우 Xenomai의 Semaphore를 이용할

경우 모든 주기에서 RTAI보다 우수한 시간적 응답 특

성을 얻을 수 있다.

2244

1416 Avera~e

Wor“

8es!

4. 주기성메 따른 실시간 메커니즘 성능 분석

4.1 세마포어(Semaphore)

Fig. 6은 세마포어의 시간적 성능 분석을 위한 의

사코드이다. Taskl 이 세마포어를 양도한 시점부터

Task2가 세마포어를 획득한 시점까지 걸린 시간을 측

정하였다. 즉, Task1 이 세마포어를 양도하고 Task2로

Switch가 일어나고 Task2가 세마포어를 획득

하기까지 걸린 시간을 측정하여 결과를 Fig. T-9에 나

타내었다.

실험 결과를 살펴보면

하고 다른 타스크가 이를

Context

Xenomai가 세마포어를 양도

획득하는데 걸리는 시간이

void Task20 f make and

4.2 실시간 FIFO Fig. 10은 커널공간의 Task 1 이 실시간 FIFO를 통

하여 사용자 공간의 타스크로 데이터를 전달하고 다시

사용자 공간에서 커널 공간의 타스크로 데이터를 전달

하는 구조를 의사쿄드로 나타내었다. 실험은 위의 일련

의 과정을 수행동}는데 걸린 시간을 측정하였다. FIFO

는 읽기와 쓰기를 모두 지원하는 모드로 사용이 불가

능하여 양방향 자료 전송을 위해 두 개의 FIFO를 사

용하였다. Xenomai의 경우 FIFO가 메시지 파이프

정의 되어있다. 실험 결과는

while(1) { ger semaphore; srop lUne measurement;

} }

Fig. 6. Pseudocode for testing semaphore

. X~nO rT‘ai 10ms • RTA’ 10m>

Fig.

보면 타스크의 주기가 짧아질수록

모두 수행시간이 감소하였다. 또한

RTAI가 제공하는 실시간 FIFO가

(Message Pipe)로

11~ 13과 같다.

실험 결과를

RTAI와 Xenomai

주기에서

3264 !

단우1: [nsl

1170

1'26

2353 Worst

뼈 -6est

모든 Fig. 7. Result of semaphore of period 10ms

總磁rr m

a a

nν a ……

/‘

d ,d

때 g

ω

,씨 g p

‘ ,‘‘

,,l ,f

void T.αsklO f

set period periodic;

""써ile(l) f put data to FIF01 ; Slart tlm,e measurement; get data from F1F02; SlOp rzme measIlremenr;

} }

다효효용E효

void mainO {

1833

3226

Av.e. rðge

Worst

make and

I Cemel Space

• Xenomai 30ms • RTAI 30ms

Semaphore_30ms

void TasklO f

set period perÏodic;

while(l) f release semapJl1Jre;‘ start tmle measurement;

} }

Se하m녀ap야hore_l0m

Average

2315

1433

1026

1277 80s!

Fig. 10. Pseudocode for testing real-time FIFO

단월 {n51

Fig. 8. Result of semaphore of period 30ms

Page 5: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

Average I; l_ 7'9-6

645

~~=====:q='=A:'~#ri t~;';I¥I ..•• f~.; 1555 W orst ~ 914

1·===*=~-~'4 76 Best 5 20

8-\!1 : [nsJ

Fig. 11. Result of FIFO of period 10ms

FIFO_30ms

1===:;:¥==&!=·~'H~.~·' I'.a 1197 Average

951 ,

;1 :::::::::.:i~.~~""¥¥ 1645 Worst :

1165

Il,:~==ie=r:; ==:M~ 917 Be.t . 869

B-\!I: [ns]

Fig. 12. Result of FIFO of period 30ms

II Xenomai • RTA l

1289 Ave rage

Wor:it ••• , 1615

1m 1' 1079 798

1259

Fig. 13. Result of FIFO of period 50ms

'2-'# : [ns]

Xenomai011J-i A~l:g-i>H=- uJ1J-1;z1 1I}01 n011 l:llii'R £~ 9-

71 011J-i fJ-~ g 1:f J-1Zl- ~Ad g y-Ej-~~Jl, t:i '7t~

~ ~ ~ g 1:f J-1 z!% Ji.Ad-i>} Jl. ~ q.

4.3 D!1~~~2~ D!IAIAIW [,1°1£1 ~%011 J-l-%~ ~ uJ1~l!fA9} uJP.·1;z1-rr~ 78

-Sf- RTAI~ uJ1~l!fA, Xenomai~ uJ1J-1;z1-rr~ API ~

A~1:g-i>}Jl. ~q. util-J-i ~ ~~011J-i~ Ad'o ~~ g R TAl 011 J-i ~ uJ1 ~ ~ A .£ .=l2.j Jl. Xenomai 011 J-i ~ uJ1 A 1

;z1-rr ~ °1%i>}~ Fig. 149} ~~ T~~ [,1°1£1 ~%

void TosklO {

set period and make periodic;

while(l) {

void Task20 (

u-hile(l) {

send message to Task2; start time measllrernent; wait for receive message from Taskl ;

m:1it for receive message from Taskl; send message to Task] ;

stop time measurement; }

} }

}

Fig. 14. Pseudocode for testing Mailbox and Message queue

011 J-l-%~~ ~J-1Zl- uJ1~'Y~~ Ad '0 g ~~i>}~q.

~~ ~ Fig. 14011 Y-Ej-\!J. ~J-}2~9} ~~ T~.£

Taskl°1 Task2011 uJ1 A1;z1 ~ ~l@-i>}Jl., qA1 Task2.£.!f­£1 uJ1 A1;z1 ~ ~~ [,1 7J};z1 ~.B..~ J-1Zl- g ~Aai>}~q.

sr:.~ 9-71 ~ ~78i>}u:j 9-71011 ut~ A1Zl--'3:j Ad'o ~}01

~ ~~i>}~q. ~~ ~J!}~ Fig. 15~17J!} ~q.

~~~J!}~ Fig. 15~17011J-i ~ Y ~~01 RTAI011 J-i A~1:g-i>}~ ~A1Zl- uJ1~'Y~CJ uJ1~l!fA011 l:l1ii'R

Xenomai~ uJ1J-1 ;z1-rr7} [,1°1£1 ~%011 *~ A1Zl--'3:j ~g ~Ad g Y-Ej-~~Jl., Ej-~3..~ 9-71011 ut~ y'6~

Mailbox& Message queue_10ms

:==1..34•04 .... 6079 Average

-==:::::::~55134i. •••• Worst [I

~::::::::~13114171111 Best 5279

B-\!I : [nsj

Fig. 15. Result of Mailbox and Message queue of period 10ms

Mailbox& Messagequeue_30ms

I

-=1I1I==11~3178121111. [I 6735 Aver-ag.e

~::::::::==::::~5SI12"1I1I1I" Worst . 10020

B-\!I. ins] ~::==i3I09iBIi. Best 54.67

Fig. 16. Result of Mailbox and Message queue of period 30ms

296 로봇학회 논문지 제7권 제4호 (2012. 12)

FIFO 10ms

• Xenomai 10ms • RTA‘ 10ms

용잃‘ 쨌i짧짧옳싫l'i썼짧繼혔뿔 796 Average

645

1555 Worst

914

~ ••• " 520 펀위 [n5j

Fig. 11. Result of FIFO of period 10ms

FIFO 30ms

. Xenorr갱i 30ms • RTAf 30ms

1197 Average

951

Worst 훌關 짧:繼總 뚫類購혔體廳;훌鍵: 짧轉 짧웠 짧짧 ι‘ 청 햇 擊 1645

1165

917

B<!st ;;;--------------------------------------- 869 펀원 [ns]

Fig. 12. Result of FIFO of period 30ms

FIFO 50ms

톨I )(~noπ\ai • RTAI

1289 A.ver~e

973

1615 Worst

1259

1079 Sest

798 펀위 [ns]

Fig. 13. Result of FIFO of period 50ms

Xenomai에서 제공하는 메시지 파이프에 비해 모든 주

기에서 짧은 응답 시간 특성을 나타내었고, 더 낮은

최악의 응답 시간을 보장하고 있다.

4.3 메일박스와 메시지큐

데이터 전송에 사용되는 메일박스와 메시지큐의 경

우 RTAI는 메일박스, Xenomai는 메시지큐만 API를

제공하고 있다. 따라서 본 논문에서는 성능 분석을

RTAI에서는 메일박스로 그리고 Xenomai에서는 메시

지큐를 이용하여 Fig. 14와 같은 구조의 데이터 전송

void ]jιrskl 0 f

set period and make void Task20 peril떠'ic; (

1써ile(l)

f ""써ile(1) f

send message to Task2; Hait for receive message from Task1 ; start time mE꼈suremen!~‘

wait for rec앙ψe message from Task2 ;

send message lO Taskl ; }

}

stop tune measurement; }

}

Fig. 14. Pseudocode for testing Mailbox and Message queue

에 사용되는 실시간 메커니즘의 성능을 분석하였다

실험은 Fig. 14에 나타낸 의사코드와 같은 구조로

Task1 이 Task2에 메시지를 전달하고, 다시 Task2로부

터 메시지를 받는 데까지 소요된 시간을 측정하였다

또한 주기를 변경하며 주기에 따른 시간적 성능 차이

를 분석하였다. 실험 결과는 Fig. 15~17과 같다.

실험결과는 Fig. 15~17에서 볼 수 있듯이 RTAI에

서 제공하는 실시간 메커니즘인 메일박스에 비해

Xenomai의 메시지큐가 데이터 전송에 우수한 시간적

반응 특성을 나타내었고, 타스크의 주기에 따른 수행

Mailbox & Message queue_l0ms

• Xenomai 10ms • RTA’ 10m>

3404 Average

6079

5534 Worst

3147 Sost

5279 단위 [nsl

Fig. 15. Result of Mailbox and Message queue of period 10ms

Mailbox& Messagequeue_30ms

• Xenomai 30m. • RTAI 30ms

Averag.e & rg‘않g갔f강 ζ I 3782

6735

Worst 際FB짧썼쩍앓w? S&〈짧쨌@;짧았&it.f3써 5512

10020

Best 嚴聯麻베빼』. 5467

단얽

Fig. 16. Result of Mailbox and Message queue of period 30ms

Page 6: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

Mailbox & Message queue_50ms

lIlII X~r.omai-MeS5age que ue • RTAI-Mailb-ox

~========~3.73.7 ..... Averaie 7090

~============:'57i07""""" Worst 10747

~======~31i89". Sest 5430 8~ . [nsj

Fig. 17. Result of Mailbox and Message queue of period 50ms

.Al n~ 7}01 ~ 7l .9l L}E}L}Al ~~q. q~ RTAI~

u11 ~~~~ 7cl~ E}..-'-3.~ ?717} {}j:W'I S; Fig. 14

01 z1- 0 ';')l A~~ /- '511 -0-1 '-. .Al? }ol zl...A.il10~ r1 9Jl::I l-A~ 0 ~ E"'C" ~ 02. T ~ n::- 1....:. O:.....l- r M '"I. ~ L..-'-

£ u11 ~~..-'-~ 7cl~ 1:1 E}~3. T~ n I:l101Ei ~~ oJl .Al-%~ ~ u1174y ~01jl, u11 .A1 A1 Tf-~ N:l ~ E}..-'-3.

T~oJl .Al .Al-%~ ~ u1174y ~01 E.£ ~AJ~'?l 1:l1.llL ~

OiDj~L} °l i::l~ {J.Aln u11 74 Y~~ .Al n~ .Ad 'o ft-~

~ {l.Aln .Al ~E~ T~oJl uR~ *%~ Ad .1:2.01q.

{l~~~ iL~l:i>}1?:! E}~3.~ ?7]Ad ~ ?71oJl u:J-4 RTAI~ Xenomai7} Ad 'o7}01 ~ .1:2.5'j...Q..uj, {l.Aln

u11 74 Y~~ 7cl~ FIFO~ RTAI7} Al1 u}~o1 ~ u11.A1Al

~~ u11 74 Y~ ~ Xenomai7} .£~ ?71oJl .Ai ~'T~ .Al

n~ g ~ ~Aj ~ L}E}1..J1 ~q.

~ ~{t-oJl.Ai ~ {:l '5~ ~ T ~:i!} ~ 1:l}% ~ E}..-'-3.

~ ?71oJl u:J-4 I:l101Ei ~% ~ %71~oJl Al-%~~ {l

.Aln u11 74 Y~ ~ qOJ~ ?71 ~ E}~3.oJl t:J1 il}O:j .Aln

~ Ad '0 ~ ft-~il} 5'j. q. ~ ~T~ ~:i!}~ {l.Aln .Al ~

E~ ~ E}~3.7} ? 71 ~ E}..-'-3.£ T ~ ~ uj ::r cj-oJl .Al

{l.Aln u11 74 Y~~ .A}%~q~ :tt~ oJl .Al {l.Aln .Al ~

E~~ Ad '0 ~ cxjl :;il}~ 7}Ad- 7 1 3::~'?l ,A}li~ Al1 i"il}jl

cv' Oi .Al uR~ *%~ Aj.1:2.01q. :E~ {l.Aln ~ l:ljlLj~

c.]~~~ 7cl~ .Al-%~ ~~ .J::.?:joJl {l~~jl Ad'o * ~oJl t:J1~ ~T7} \j~~ ~oJl.Ai uR~ -71~~ ~:i!}

olq.

'8'lo "5" OE.. ..A...-'-;=J ..:::L~~ .A1.Al?} .Al ..-'-E4101 u110l.l 11 o---r J..-\....- .:....l--..:r- I ~ ~ 2. L!. - o~ / I .....,

Zo lolA~~ ~ill n'l 01..A1 .A1 '8'~ 73';')loJl 1"'ll '8'1- .$~o l ~ A08~ o "'l:C -, a. 0 r, n L.. 2. '0 /2,. -"I '-fj ~ ~ L..

ill 3I}Q.{il}jl,A} ~q. :E~ ~~~ {l.Al n u11 74 Y ~~

T~~q1?:! ~'T~ Aj '0 ~ {l.Aln ~ l:ljlLj ~ c.]~~~

[1 ] Tim Bird, "Comparing two approaches to

real-time Linux", www. linuxdevices.com. 2002

[2] Ismael Ripoll,"RTLinux versus RTAI",

www.linuxdevices.com. 2002

[3] Kevin Dankwardt, "Comparing real-time Linux

alternatives", www.linuxdevices .com. 2000

[4] W . S. Liu, Real-Time System, Prentice Hall,

2000

[5] D.Abbout, "Linux for Embedded and Real-time

Applications", Elsevier, 2006

[6] M.D. Marieska, A.1. Kistijantoro, and M. Sub air,

"Analysis and Benchmarking Performance of Real

Time Patch Linux and Xenomai in Serving a

Real Time Application," Proc. of International

Conf. on Electrical Engineering and Informatics,

pp.l-6, 2011

[7] P. Kadionik, B. Le Gal, H. Levi, Ben Atitallah,

"A. Performances analysis and evaluation of

Xenomai with a H.264/ A VC decoder," Proc. of

International Conf. on Microeletronics, pp.1A,

2011

[8] G. Zhang, L. Chen, and A. Yao, "Study and

Comparison of the RTHAL-based and

ADEOS-based RTAI Real-time Solutions for

Linux," Proc. of International Multi-Symposium

on Computer and Computational Sciences,

pp.77 1-775 , 2006

[9] M . Liu, D. Liu, Y. Wang, M. Wang, and Z.

Shao, "On Improving Real-Time Interrupt

Latencies of Hybrid Operating Systems with

Two-Level Hardware Interrupts," IEEE Trans. on

Computers, Vo1.60, No. 7, pp.978-991 , 2001

[10] Choi, B .W , "A Review and Outlook of Robotics

Software Framework", 1. of Korean Robotic

Society, Vo15, No2, pp169-176, 2010

[11] A.Barbalace, A. Lunchetta, G Manduchi, M .Moro,

A. Soppelsa and C. Taliercio, "Performance

Comparison of VxWorks, Linux, RTAI and

XENOMAI in a Hard Real-time Application,"

실시간 엄베디드 리녹스에서 다양한 주기적 타스크의 실시간 메커니즘 성능 분석 297

구현할 수 있을 것으로 기대된다.

to

RTAI" ,

Linux

Hall,

Real-time

versus

real-time

Bird, “ Comparing two approaches

real-time Linux", www.linuxdevices.com. 2002

Ripoll,“RTLinux

www.\inuxdevices.com. 2002

Kevin Dankwardt, “ Comparing

altematives", www.linuxdevices.com. 2000

Liu, Real-Time System, Prentice

D.Abbout, "Linux

Applications", Elsevier, 2006

[6] M.D. Marieska, A.I. Kistij antoro, and M. Subair,

“ Analysis and Benchmarking Performance of Real

Patch Linux and Xenomai

참고문헌

Tim n [

Ismael [2]

[3]

10747

Mailbox & Message queue_50ms

_RTA’ Mailbo)( .. X~"omai-M~ s.sag:e Queue

7090

5707

단의 [nsl 5430

3737

Worst

e

A

r l

--i

l l ---j

i l --1

1 1 1

6est

and Embedded for

S. W.

2000

[4]

[5]

Serving

of Intemational

a m

Application,’,

on Electrical Engineering and

Proc. Time

Time

Real

Fig . 17. Result of Mailbox and Message queue of period 50ms

시간의 차이는 거의 나타나지 않았다. 다만 RTAI의

메일박스의 경우 타스크의 주기가 감소할수록 Fig. 14

와 같은 과정을 수행하는 시간이 감소하였다 일반적으

로 메일박스의 경우 1: 1 타스크 구조 간 데이터 전달

에 사용되는 메커니즘이고 메시지큐는 N:l의 타스크

구조에서 사용되는 메커니즘이므로 직접적인 비교는

어려우나 이러한 실시간 메커니즘의 시간적 성능 분석

은 실시간 시스템 구현에 매우 유용한 정보이다. lnformatics, pp.I -6, 2011

[7] P. Kadionik, B. Le Ga!, H. Levi, Ben Atitallah,

“A. Performances analysis and evaluation of

Xenomai with a H.264/AVC decoder," Proc. of

Conf. on Microeletronics, pp.I-4,

[8] and

and

Yao, “ Study

RTHAL-based

A. Chen, and

the of

Conf.

Intemational

2011

G. Zhang, L.

Comparison

ADEOS-based for Real-time

of Intemational

and

Liu, Y. Wang, M. Wang, and Z.

Improving Real-Time Interrupt

Hybrid Operating Systems with

Two-Leve l Hardware Interrupts," IEEE Trans. on

Computers, Vo1.60, No.7, pp.978-99 1, 2001

[1이 Choi, B.W, “ A Review and Outlook of Robotics

Software Framework", J.

Society, Vo15 , N02, ppI69-1 76, 2010

[11] A.Barbalace, A. Lunchetta, G Manduchi , M.Moro,

A. Soppelsa and C. Taliercio, "Performance

Comparison of VxWorks, Linux, XENOMAI in a Hard Real-time Application,"

Multi-Symposium

Sciences,

Robotic

and

Solutions

RTAI

Korean

Computational

of

RTAI

Linux." Proc.

Computer

pp.77 1-775, 2006

M. Liu, D.

Shao, “ On

Latencies of

on

[9]

실험결과를 요약하면 타스크의 주기성은 주기에 따

라 RTAI와 Xenomai가 성능차이를 보였으며, 실시간

메커니즘의 경우 FIFO논 RTAI가 세마포어 및 메시지

전달 메커니즘은 Xenomai가 모든 주기에서 우수한 시

간적 응답 특성을 나타내었다.

본 논문에서는 선행 연구 결과를 바탕으로 타스크

의 주기에 따라 데이터 전송 및 동기화에 사용되는 실

시간 메커니즘을 다양한 주기적 타스크에 대하여 시간

적 성능을 분석하였다. 본 연구의 결과는 실시간 시스

템의 타스크가 주기적 타스크로 구현되며 그 안에서

실시간 메커니즘을 사용한다는 관점에서 실시간 시스

템의 성능을 예측하는 가장 기초적인 자료를 제공하고

있어서 매우 유용한 정보이다. 또한 실시간 임베디드

리녹스의 경우 사용을 위한 노력에 집중되고 성능 분

석에 대한 연구가 없었다는 점에서 매우 귀중한 결과

이다

향후 오픈 소스로 구현된 실시간 시스템의 메커니

즘 분석을 통하여 앞선 실험 결과에 대한 원인을 정확

히 파악하고자 한다. 또한 최적의 실시간 메커니즘을

구현한다면 우수한 성능의 실시간 임베디드 리녹스를

5. 결론

Page 7: New 실시간 임베디드 리녹스에서 다양한 주기적 타스크의 실시간 ...embedded.snut.ac.kr/bbs/paper/domestic_journal/On... · 2013. 1. 14. · real-time embedded

Proc. of Real-Time Conference 2007 15th

IEEE-NPSS, pp.I-5, May 2007.

[12] M. Franke, "A Quantitative Comparison of

Realtime Linux Solutions," Chemnitz University

of Technology, 2007.

[13] Koh, 1.H, Choi, B.W, "Performance Evaluation of

Real-time Mechanisms for Real-time Embedded

Linux" , 1. of Institute of Control, Robotics and

Systems, VollS, No.4, pp. 337-342, 2012.

[14] uC/OS-III, http://micrium.com

.::il oXH !!-2011 Ai%3ZJ-~71~qj~Jl!. ~

71~~3ZJ- (~~A})

2001-~AH Ai%3ZJ-~71~qj~

Jl!. ~71~~3ZJ- -6:]A}3ZJ-AJ :t!{J~oF: ~A1Zl ~oJ~lAl

<f1Hj]q~ c1~~, Al'o~

Ai1:l]~~*.

~I ~ ~

1986 ~~-3"J~qj&Jl!. -3"J~~

A}~&3ZJ- (~~A})

1988 ~~.ll}&71~~ ~71~

~A}~&3ZJ- (~~-6:]A})

1992 ~~3ZJ-&71~~ ~71~

~A}( ~~1fI-A})

1988- 2000 LG{!-~'T~§]A} ~c1Hj]olEi C{!.:r~AJ

~ <f11lj] q ~ Al ~ l@ C{!.:rl%l AJ 2000- 2005 {i~qj~Jl!. A11017-l1~~~3ZJ-1f-Jl!.'T

2007- 2008 Nanyang Technological University, Senior

Fellow

2005- ~AH Ai%3ZJ-&7]~qj~Jl!. ~7]AJ.5!.~~3ZJ- Jl!.'T :t!{J~oF : <f1Hj]q~ Al~E~ , <f11lj]q~ c1~~, ~Al

Zl~oa j11A1l,Al'o~ ~* g%,~TIE..~~lo1 ~

~%

298 로봇학회 논문지 제7권 제4호 (2012. 12)

Proc. of Real -Time Conference 2007 15th

IEEE-NPSS, pp.I-5, May 2007.

[12] M. Fra따ce , "A Quantitative Comparison of

Realtime Linux Solutions," Chemnitz University

of Technology, 2007 .

[13] Koh, 1.H, Choi, B.W, "Performance Evaluation of

Real-time Mechanisms for Real-time Embedded

Linux" , 1. of Institute of Control, Robotics and

Systems, Vo1l 8, No.4, pp. 337-342, 2012

[14] uC/OS-III, http://rnicrium.com

고재환

2011 서울과학기술대학교 전

기공학과(공학사)

2001-현재 서울과학기술대학

교전기공학과석사과정

관심분야 실시간 운영체제,

임베디드 리녹스, 지능형

서비스로봇

최 병욱

1986 한국항공대학교 항공전

자공학과(공학사)

1988 한국과학기술원 전기및

전자공학과 (공학석사)

1992 한국과학기술원 전기및

전자(공학박사)

1988- 2000 LO산전주식회사 엘리베이터 연구실장

및 임베디드시스댐 연구팀장

2000-2005 선문대학교제어계측공학과부교수

2007- 2008 Nanyang Technological University, Senior

Fellow

2005-현재 서울과학기술대학교 전기정보공학과교수

관심분야: 임베디드시스템, 임베디드리녹스, 실시

간운영체제, 지능형 로봇응용,소프트웨어 플

랫폼


Recommended