Exokernels + Erlang Exploring novel operating_systems architectures to increase performance


Exok ernels + Erlang: Exploring no v el op erating systems arc hitectures to increase p erformance Bj orn Kn utsson ?  Bjorn.Knutsson@DoCS.UU.SE  Uppsala Univ ersit y , Dept. of Computer Systems, Bo x 325, S-751 05 Uppsala, Sw eden. 1 In tro duction The curren t breed of non-exp erimen tal op erating systems all ha v e a lot in com- mon. They sim ultaneously abstract and m ultiplex hardw are resources in a w a y that will w ork for almost all p ossible applications. Often p ortabilit y is also an issue | they try to pro vide an abstraction that is not sp eci c to a certain im- plemen tation of e.g. hard disks or net w ork cards, but they t ypically do not stop there. They also implemen t additional general abstractions suc h as le systems and proto col stac ks. T ypically , these mec hanisms are in tegrated with securit yin a suc hw a y that y ou cannot circum v en t them without losing secure m ultiplexing of the hardw are resources. This generalit y means that op erating systems will abstract a w a y most of the underlying hardw are seman tics, and e ectiv ely hide it from the applications. This has the great adv an tage that the applications are p ortable across a wide arra y of di eren t hardw are with di eren t seman tics. It do es, ho w ev er, also ha v e the unfortunate disadv an tage of making optimized implemen tations hard and/or exp ensiv e. Inat ypical \safe" m ultitasking OS, e.g a UNIX system, if w ew an t to mak e use of kno wledge of the underlying hardw are arc hitecture, w em ust do one of: { allo cate a whole device e.g a whole disk partition { mo dify the k ernel { giv e the application sp ecial privileges to directly access hardw are e.g. SUID ro ot in UNIX In the rst and last cases, this will often mean that the application will b e giv en exclusiv e access to the resource, and the last case also means that privileges outside of the needed will b e gran ted. Mo difying the k ernel has the unfortunate side e ect of c hanging the b eha vior not only for the sp eci c application, but for the whole system not to men tion ? F unded b y Ericsson CSLAB requiring a reb o ot. Also, it can only b e undertak en if the source co de of the OS is a v ailable. Finally , it means that the k ernel will gro w for eac h application w e w an ttobe able to optimize p erformance for regardless of whether this feature is in fact used or not. 2 Exok ernels Exok ernels[EK O95 ][KEG + 97 ] is an attempt to solv e this problem b y reducing or eliminating all abstractions not explicitly needed for safe m ultiplexing of the underlying hardw are. An exok ernel will exp ort all information that is safe to exp ort to the application, and also allo w the application to directly administer its o wn resources. In man yw a ys, the design of exok ernels is similar to that of Nemesis[LMB + 96 ], an op erating system whic h fo cuses on Qualit y of Service issues rather than p er- formance. Remo ving all OS abstractions ma y seem lik e a step bac kw ards to pre-OS da ys, but w e actually k eep the go o d part: safe m ultiplexing. Just as w etoda y link our applications with run time libraries, w e could also link them with library OSs, to regain the b ene ts, but without pa ying the p enalt y asso ciated with k ernel OS abstractions. F or man y applications, p erformance is not paramoun t, and w ew ould link these with a library OS not unlik e the OSs of to da y . But if w e w an ted to optimize some asp ects of the OS, w e could do this directly , with ne gran ularit y , without a ecting other applications and without ha ving to giv e unnecessary privileges to applications. X OK[KEG + 97 ] is a In tel x86 based exp erimen tal exok ernel, and ExOS is the default library op erating system running on top of X OK. ExOS implemen ts most of the functionalit y of a BSD 4.4 UNIX system. 3 Our goals The aim of our curren t researc h is to determine to what exten tw e can use the exok ernel ideas for \real" applications. The exok ernel team ha v e iden ti ed a n um b er of general areas and explored some of them, and w e aim to in v estigate some new areas as w ell as examining the concepts and ideas b ehind exok ernels. Our aim is also to ev aluate the limitations imp osed b y b oth the underlying exok ernel ideas and the sp eci c design of X OK, e.g. will the exok ernel ideas and design a ect what can b e implemen ted? W e are w orking with the implemen tation of the concurren t functional language Erlang[A VWW93 ]. The Erlang system is a fairly large application in itself, whic h mak es it an in teresting platform for exp erimen ts. F urthermore, it is a tempting target for impro v emen t, since an y p erformance gain w e can ac hiev e will b ene t man y or all programs written in Erlang. There are impro v emen ts in man y areas that can be attempted, but since our group has exp erience in proto col implemen tations, w e will at least initially fo cus on impro v emen ts that help p erformance of proto col implemen tations in Erlang. 4 W ork in progress W eha v e recen tly got our p ort of Erlang to ExOS/X OK to w ork and are curren tly cleaning it up and ev aluating the v ery rst real b enc hmarks. Our next step is to start exp erimen ting with impro v emen ts in the areas w e already ha v e iden ti ed. W e exp ect that w e, during these exp erimen ts, also will b e able to iden tify new areas of impro v emen t. Previous w ork[KEG + 97 ] has iden ti ed greater con trol o v er resources as the main b ene t of the exok ernel arc hitecture. T o b e able to exploit this con trol requires an in timate kno wledge of ho w the resources will b e used in the application. Since Erlang programs can do just ab out an ything with resources, w e cannot kno w enough to impro v e resource use. W e can, ho w ev er, w ork to impro v e the Erlang in terpreter and run time system. If w e allo w ourself to limit us to a smaller class of programs, or parts of programs, w e thereb y gain more sp eci c kno wledge of resource use, making impro v emen ts p ossible. W e ha v ec hosen proto col implemen tations in Erlang as a fo cus area, and are w orking to impro v e p erformance of this sub class of Erlang programs. The situation is actually analogous to traditional op erating systems | if w e kno w b eforehand what t yp es of applications an OS will run, w e can include supp ort to optimize p erformance for these sp eci c t yp es of applications. 5 Preliminary results W e regard ha ving a w orking Erlang system as our primary result so far, not only for con tin ued w ork in the pro ject, but also b ecause it tells us something more: The fact that with a fairly small e ort, a complex application lik e the Erlang system can b e p orted to an exok ernel and run at sp eeds comparable to a standard UNIX system, means w e're not pa ying m uc h for the added exibilit y . W orking with an existing application has also b een v ery instructiv e. The strength of exok ernels is that y ou can exploit kno wledge ab out y our application to increase p erformance and b etter utilize resources. E.g., if I kno w that I am no longer using a page of memory , I can unmap it and release the ph ysical page bac kto the common p o ol. Doing this means b oth that I will utilize resources b etter I'm only holding pages I really need, and will also increase p erformance since an y pro cess that needs a page can get one immediately , instead of rst ha ving to write out m y in fact un used page to disk. Also, if this happ ens and I later w an t that sp eci c virtual page bac k, I will not need to read it bac k from disk I already kno w that it only con tained garbage an yw a y. Ho w ev er, an application written e.g. for UNIX, will rely on the underlying OS to handle memory , and will th us not retain the kno wledge needed to mak e this kind of optimizations. Making the application a w are of its resource utilization means a ma jor o v erhaul of b oth design and implemen tation. Dep ending on the application and its requiremen ts, this ma yorma y not b e w orth the e ort. A complicating circumstance is that in am ulti-platform application, y ou ma y not w an ttoin tro duce sp ecial cases in the platform-indep enden t part, for main- tenance reasons. T oa v oid this problem with Erlang, w e fo cus on Erlang's op erating system in- terface, a part that is already platform dep enden t. W e are also w orking b eneath Erlang, adapting the op erating system to b etter t Erlang. This strategy is only p ossible b ecause eac h exok ernel pro cess has its o wn op erating system. References [A VWW93] Jo e Armstrong, Rob ert Virding, Claes Wikstr om, and Mik e Williams. Concurr ent Pr o gr amming in Erlang . Pren tice Hall, 1993. [EK O95] Da wson R. Engler, M. F rans Kaasho ek, and James W. O'T o ole Jr. Ex- ok ernel: An op erating system arc hitecture for application-lev el resource managermen t. In Pr o c e e dings of the Fifte enth Symp osium on Op er ating System Principles , pages 251{266, Decem b er 1995. [KEG + 97] M. F rans Kaasho ek, Da wson R. Engler, Gregory R. Ganger, H ector M. Brice ~ no, Russell Hun t, Da vid Mazi eres, Thomas Pinc kney , Rob ert Grimm, John Jannotti, and Kenneth Mac k enzie. Application P erformance and Flexibilit y on Exok ernel Systems. In Pr o c e e dings of the Sixte enth Symp o- sium on Op er ating System Principles , Octob er 1997. [LMB + 96] Ian Leslie, Derek McAuley , Ric hard Blac k, Timoth y Rosco e, P aul Barham, Da vid Ev ers, Robin F airbairns, and Eoin Hyden. The Design and Imple- men tation of an Op erating System to Supp ort Distributed Multimedia Ap- plications. IEEE Journal on Sele cte dA r e as in Communic ation , 147:1280{ 1297, Septem b er 1996.
还剩3页未读

继续阅读

下载pdf到电脑,查找使用更方便

pdf的实际排版效果,会与网站的显示效果略有不同!!

需要 6 金币 [ 分享pdf获得金币 ] 0 人已下载

下载pdf