Deploying Preemptible Linux in the Latest Camcorder

Deploying Preemptible Linux in the Latest Camcorder

Deploying Preemptible Linux in the Latest Camcorder Geunsik Lim Jupyung Lee Sangbum Suh Samsung Electronics Samsung Electronics Samsung Electronics [email protected] [email protected] [email protected] Abstract on Linux such as Maemo, Moblin, Android, and Palm- Pre are in progress. Currently, the Linux kernel is well equipped to compete with the soft realtime operating system. Linux has been Particularly, when starting with Linux version 2.6, the choices of the operating system. We adjusted opti- realtime functionalities[19] such as O(1) Scheduler, mized Linux kernel to the camcorder’s system architec- Threaded Interrupt Handling, Preemptible Kernel[8], ture which is equipped with ARM cortex-A8 and imple- Priority Inheritance, High Resolution Timer[5], Tick- mented open-source based tool-chain, audio zoom cal- less Timer and Userspace Realtime Mutex[2] have been culation, and realtime HDMI I2C communication and added so that they are being used for embedded devices userspace realtime thread program. Samsung has intro- which require responsiveness as important factor. duced Consumer Electronics Show(CES) this year with its new S-Series of full HD digital camcorders. These For example, Commercial RHEL-RT[18] that its real- product is the world’s first commercially available cam- time property is improved by Ingo Molnar[9] who is one corder which includes built-in Wi-Fi and DLNA con- of the realtime system developers, currently working nectivity. for Red Hat has been applied for USS Zumwalt (DDG- 1000, U.S. Navy Next-Generation Destroyer) to ensure This paper describes our trouble shooting, cross- that computers response correctly without halt & stop compiler issues, technical experiences and best practice of computers or failure of synchronization with other in reducing latency in Linux and applications for devel- events. oping an embedded product like camcorder. This dis- cussion focuses on how commercial platform can opti- However, when originally development of the Linux mize the realtime extensions available in Linux kernel, kernel began, it was not designed for the purpose of re- but it is also relevant to any software developer who may altime property. That is why Linux may be suitable for be concerned with finding a suitable tradeoff between the system that required the soft realtime property, not throughput and responsiveness for embedded systems. the hard realtime property. Furthermore, many methods which implemented to fur- ther improve the system performance will be presented Although Linux is continuously being developed to be as well. closer to the hard realtime property by many open- source developers[1, 23] non-preemptible critical sec- 1 Introduction tions and interrupt off sections still exist in the RT patched Linux kernel. Since 2000, commercial RTOSs such as pSOS, LynxOS, QNX, Nucleus, Vxworks that have been used in em- In the case of full HD camcorder, commercial cam- bedded devices have been replaced by Linux kernel. corders have been developed by adopting RTOSs such For home appliances such as Digital TV, camcorder, as Vxworks, TronOS instead of Linux for the OS in or- digital camera, printer, etc., electronic companies have der to meet realtime property. However, commercializa- improved their differentiation and competitiveness by tion was attempted for the full HD camcorders from the modifying open-source software for each product use Samsung camcorder S-Series based on the Linux 2.6.29 since they adopted Linux which has the advantage not to kernel considering the advantages that the payment for require paying royalty. For mobile platform such as mo- royalty is not required and the source can be freely mod- bile phone, variable commercialization projects based ified. 1 The Samsung camcorder S-Series offer both built-in size when we are recording mass files like camcorder Wi-Fi and DLNA connectivity and feature Samsung particularly. AllShare that allows users to easily access, manage, and share content including their full-HD videos across When performing memory unmap with system call to other DLNA certified devices. The Samsung full HD virtual memory area used by user, it improves real- camcorder is commercially available in the worldwide time property by reducing the size of non-preemptible market. sections associated with the unmap operation through the minimization of "ZAP_BLOCK_SIZE". However, the memory unmap operation results in delay due to 2 Responsiveness VS. Throughput the minimized "ZAP_BLOCK_SIZE". In this case, we recommend that default memory range to unmap allo- The goal of Real Time Operating System(RTOS) is to cated memory from 8 pages to 1,024 pages. Figure 1 provide a predictable and deterministic environment. shows operation comparison between the memory un- The primary purpose is not to increase the speed of the map ranges. We can not find side-effect during the sot- system[6], or lower the latency between an action and ware quality assurance test after adjusting this approach response, although both of these increase the quality of . a RTOS[14]. The unmap operations were repeated 3,328 times with Many companies have basically adopted RT patched 8 pages units in order to reset the 100MB of memory, Linux kernel for their embedded products recently in or- and check out whether any task with higher realtime der to meet realtime property. When running software priority is waiting every time unmapping is completed in such a system, tradeoff between responsiveness and in each 8 pages units for realtime property. If any task throughput is often found. Otherwise, responsiveness with higher realtime priority exists, the task preempts and throughput are inversely related. the current task and the memory unmap operation will be performed again after finishing the task. At the mo- The overhead for realtime preemption is applicable for ment, It takes more than 3 seconds to unmap 100MB of these cases [16]. memory with 8 pages units in our test, and the average share of CPU during the time accounted for 92% - 98%. • Mutex operations more complex than spinlock op- For a camcorder in this paper, as mass files have to erations be recorded, memory has to be allocated with 100MB unit and reset. When changing the boundary between • Priority inheritance on mutex increases task responsiveness and throughput to 1,024 pages from 8 switching pages through repeated tests, it showed the most realis- • Priority inheritance increases Worst-Case Execu- tic performance. After changing the policy of memory tion Time(WCET) unmap which changes minimum unit for memory un- mapping to 1,024 pages, the switching time from play mode to recording mode in mass production has been And, flexible design allows much better worst case sce- improved from 3 seconds and more to less than 1 sec- narios in embedded products. ond. In our experiment, We decided that the best page size of unmap operation was 1,024 pages without the • Realtime tasks are designed to use kernel resources more page size like 2,048 pages and 4,096 pages to con- in managed ways then delays can be eliminated or sider both throughput and responsiveness. reduced When unmapping 100MB that was allocated for record- ing video files through the Software Quality Assur- For example, For recording mass files, if we try to un- ance(SQA) test process before and after changing the map memory that we allocated with 100MB for record- unit in camcorders, it showed that the performance of ing in camcorder, we have to wait for more than 3sec- unmap_page_range() with 1,024 page unit is effective onds to change mode from play mode to recording to solve the memory unmap operation issue is delayed mode. This results from the unit of memory unmapped due to the minimized "ZAP_BLOCK_SIZE". 2 built-in HDMI1.3 interface allows output of captured or downloaded mobile multimedia contents to an external high definition digital display. Figure 1: Operation comparison between the memory unmap ranges 3 Cross Compiler to solve low clock speed Figure 2: S5PC110(Cortex-A8) Architecture map While we prepared for the mass production of the Sam- sung camcorder, we tried that the clock speed for the product should be changed from 800Mhz to 600 Mhz 3.2 How to overcome low clock speed to reduce overall power consumption of camcorder. It means that the lower clock speed is suitable for com- First of all, We considered software technologies to min- mercial product if we can. After the change of the imize code size and optimized throughput according to clock speed is adjusted, Video recording test is failed the compiler option tuning, As a result, we passed 68% on SQA test before production release because of low with GCC 4.4.3 based tuned toolchain and passed others clock speed. with updated AudioZoom engine library. Fortunately, we overcomed the problem of low clock speed with soft- ware approaches to observe the development schedule 3.1 S5PC110 hardware specification that we had to work successfully for commericial prod- uct. Before explaining the problem, We first presents hard- ware characteristics of Samsung camcorder. The 3.3 GCC optimization for performance & code size S5PC110 is targeted for small form-factor connected de- vices such as multimedia intensive smart phones in Fig- This optimization can provide significant increases in ure 2, while the S5PV210 is aimed at portable comput- performance and equally significant reductions in code ing devices such as netbooks that demand high perfor- size for camcorder[4]. mance and design flexibility.[21] The default inline options for camcorder are following. High speed 3D graphics rendering and high resolu- -finline-functions tion video support are two key differentiating features -fno-inline-functions-called-once for advanced mobile devices. Both the S5PC110 and S5PV210 are equipped with a powerful built-in POW- Below are options that we found via mobile software ERVR SGX 3D graphics engine, licensed from Imag- platform study like Android[22], Moblin, Maemo.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us