
Performance Characterization of Prelinking and Preloading for Embedded Systems ∗ Changhee Jung Duk-Kyun Woo Kanghee Kim Embedded Software Research Embedded Software Research Mobile Communication Division Division Division ETRI ETRI Telecommunication Network Daejon, 305-700, Korea Daejon, 305-700, Korea Business [email protected] [email protected] Samsung Electronics Co., LTD. [email protected] Sung-Soo Lim School of Computer Science Kookmin University Seongbuk-gu, Seoul, Korea 136-702 [email protected] ABSTRACT are reduced up to 71% and relocation counts are reduced up Application launching times in embedded systems are more to 91% in the benchmark programs we used. crucial than in general-purpose systems since the response times of embedded applications are significantly affected by Categories and Subject Descriptors the launching times. As general-purpose operating systems D.3.4 [Programming Languages]: Processors—compil- are increasingly used in embedded systems, reducing appli- ers, run-time environment;D.4[Operating Systems]: Or- cation launching times are one of the most influential factors ganization and Design—real-time systems and embedded sys- for performance improvement. In order to reduce the appli- tems cation launching times, three factors should be considered at the same time: relocation time, symbol resolution time, and binary loading time. In this paper, we propose a new ap- General Terms plication execution model using a combination of prelinking Design, Performance and preloading to reduce the relocation, symbol resolution, and binary load overheads at the same time. Such applica- tion execution model is realized using fork and dlopen exe- Keywords cution model instead of traditional fork and exec execution embedded systems, prelinking, preloading, application launch- model. We evaluate the performance effect of the proposed ing fork and dlopen application execution model on a Linux- based embedded system using XScale processor. By apply- ing the proposed application execution model using both 1. INTRODUCTION prelinking and preloading, the application launching times Dynamically linked applications have been increasingly used in embedded systems as general purpose operating sys- ∗ This work was supported in part by the IT R&D program of tems are adopted in embedded systems. As more diverse ap- MIC/IITA [2006-S-038-02, Development of Device-Adaptive plications with significant sizes are installed for such embed- Embedded Operating System for Mobile Convergence Com- ded systems, the portion of dynamically linked applications puting], in part by No. 379 from the Basic Research Pro- increase accordingly. Therefore, the shared library process- gram of KOSEF, and in part by the MIC, Korea under the ITRC (Information Technology Research Center) support ing times including relocation, symbol resolution, and li- program supervised by the IITA (IITA-2006-C1090-0603- brary image loading steps have substantial impact on the 0045). overall application execution performance. For example, in [1], the GNOME startup time analysis results show that the most of the IO operations are due to shared library oper- ations and around 65 % of non-contiguous IOs come from Permission to make digital or hard copies of all or part of this work for library accesses. personal or classroom use is granted without fee provided that copies are Application launching overhead is more crucial in embed- not made or distributed for profit or commercial advantage and that copies ded systems since the hardware performance of the embed- bear this notice and the full citation on the first page. To copy otherwise, to ded systems is not comparable to the performance of general republish, to post on servers or to redistribute to lists, requires prior specific purpose systems. Moreover, the prolonged launching times permission and/or a fee. EMSOFT’07, September 30–October 3, 2007, Salzburg, Austria. could not be accepted in user-interactive consumer electron- Copyright 2007 ACM 978-1-59593-825-1/07/0009 ...$5.00. ics products since the response times of applications would 213 directly affect the values of the products (i.e., the launch- number of issues in application execution performance. Ef- ing time of HTML or WAP browser in mobile phones, the ficient dynamic linking has been discussed and implemented launching time of document viewer in PDAs and phones). in single-address-space operating systems such as Mungi [5, Optimizing such application launching times through effi- 3] and Nemesis [12] and the dynamic linking scheme has cient handling of dynamically linked applications is neces- been used in Iguana project [4] which is a modified version sary in the products. of Mungi and used for commercialized systems. Most of In this paper, we propose an application execution model the issues in dynamic linking in single address space have to reduce the handling cost of dynamically linked applica- been discussed in [5, 3, 12] and those discussions could be tions in launching applications: we perform relocation, sym- well considered in general purpose operating systems. In bol resolution, and shared library binary loading in advance this paper, we aim at devising and evaluating a method for before application execution. The prelinking (i.e., reloca- efficient dynamic linking that could be practically used for tion and symbol resolution before application execution) and general purpose operating systems such as Linux. preloading (i.e., shared library binary loading before execu- Prelinking [8] is an ELF image translation to speed up tion) techniques are combined in an application execution dynamic linking of ELF programs. It tries to remove sym- environment by modification of the existing dynamic linker. bol resolutions of ELF programs by incorporating the simple In order to apply the combined techniques to the exist- philosophy of the a.out binary format into the ELF format ing general purpose OS-based systems, the fork and dlopen without compromising its flexibility. That is, it assigns a model is used for application execution instead of fork and base address to which every shared library in the system exec model. In the fork and dlopen model, the applications should be mapped, and according to the base addresses, are launched as shared objects by an application launcher performs all symbol resolutions at link time. If there exists and the shared libraries needed to execute the applications a case where the base address assigned to a prelinked shared are prelinked and preloaded by the launcher. library is already occupied by another shared library (e.g., The fork and dlopen application execution model with pre- when a non-prelinked library is already loaded to the base linking and preloading naturally gives a number of restric- address), all symbol resolutions performed at link time for tions in launching and running applications. First, as we the prelinked library are cancelled at load time of the li- mentioned above, the applications need to be changed to brary, and the library is handled as a normal non-prelinked shared objects and launched through dlopen. Second, most ELF library; that is, the base address is dynamically de- of the applications in a system need to be covered by pre- termined by the system, and the symbol resolutions occur determined set of shared libraries so that additional shared during the run time of the program. To make an effective library loading would not be needed at run-time. Though use of prelinking, it is important to cover as many shared the factors mentioned above seem to impair the flexibility libraries as possible in system design phase, thus reducing of the system, the consumer electronics embedded systems the possibility of non-prelinked libraries in system operating could well accept the application execution model due to phase. their characteristics. The consumer electronics products On the other hand, fixed-up image caching [11] is an op- such as smartphones, portable media players, and set-top erating system level technique developed in Spring OS to boxes normally have a centralized application launcher who speed up dynamic linking. The basic idea is to maintain a controls the launching and termination of other applications. cached copy of application executables and shared libraries, In addition, the shared libraries used by the applications once the corresponding applications are launched and ter- could be well predetermined since most of the applications minated. If an application has to be launched later, the are fixed from factory configuration and additional applica- cached copy of the associated executable and shared libraries tions would also utilize the already installed shared libraries. is used. In this approach, it is important to assign a unique Moreover, once the products boot and start to run, the prod- base address to each shared library, in order not to main- ucts are rarely rebooted, but typically woken-up from sus- tain multiple copies of a single shared library due to different pended modes. This would hide the launching time of the base addresses. Since the approach requires large memory application launcher itself and preloading times of shared space for image caching, it is not adequate for embedded libraries since these are performed at boot time. Especially systems with no swap. for mobile phones, the system boot is normally accompanied One final resort to completely avoid relocation, symbol by subscriber registration process and thus the prolonged resolutions, and library loading is to come back to static launching time would not affect the user perception. linking. In [2], static linking is revisited as an alternative We implemented the application execution model in a to dynamic linking, which is combined with a notion called Linux-based embedded system with modification of dynamic message digests to reduce the space overhead imposed by linker in GCC. We evaluated the performance improvement static linking in terms of both memory and disk. However, of the fork and dlopen application execution model with the the space overhead of 40% relative to dynamic linking is too previous fork and exec model using a number of benchmark high for general purpose OS-based embedded systems we programs.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-