linux快速启动优化,linux快速启动方案,启动时间优化

《linux快速启动方案,启动时间优化》由会员分享,可在线阅读,更多相关《linux快速启动方案,启动时间优化(22页珍藏版)》请在技术文库上搜索。

1、Optimizing Linux Boot Time,This session gives an overview of methods for optimizing the boot time of a Linux system,July 2012,LAB: http:/processors.wiki.ti.com/index.php/Sitara_Linux_Training,Pre-work Check List,Installed and configured VMWare Player v4 or later Installed Ubuntu 10.04Installed the l。

2、atest Sitara Linux SDK and CCSv5Within the Sitara Linux SDK, ran the setup.sh (to install required host packages)Using a Sitara EVM, followed the QSG to connect ethernet, serial cables, SD card and 5V powerBooted the EVM and noticed the Matrix GUI application launcher on the LCDPulled the ipaddr of 。

3、your EVM and ran remote Matrix using a web browserBrought the USB to Serial cable you confirmed on your setup (preferable),Agenda,What is Fast Boot?Boot Process OverviewMeasuring Boot TimeIdentifying the Boot StepsProfilingU-bootLinux KernelOptimization TechniquesU-bootLinux KernelFile System,What i。

4、s Fast Boot?,Fast boot refers to minimizing the boot time of a system. The boot time of the system is the time it takes from the application of power to the system becoming “available”“Available” has a lot of different meanings depending on the user expectations.Appearance of the home screen for dev。

5、ices like cell phonesAn audible tone or LED indicatorA Linux promptBecoming discoverable on the networkHaving a key peripheral become availableThe above variances show why the Sitara Linux SDK is generally not fully optimized for boot time. Each user can have a different target and a generic SDK can。

6、not satisfy all user targetsThere are also many features that make for a good development environment, but which do not make for a fast booting environment,Boot Process Overview,Measuring Boot Time,There are a couple of different options for measuring boot time. You can use a C program that time sta。

7、mps each line on the serial port.http:/processors.wiki.ti.com/index.php/Measuring_Boot_TimeCompile with “gcc tstamp.c -o tstamp”This can also be invoked as “cat /dev/ | tstampRealTerm for Windows supports time stamping the incoming serial datahttp:/realterm.sourceforge.net/Support logging in Unix da。

8、te formatAbility to log directly to a fileAbility to stop logging after a predefined timeNo need to switch terminal for interactive sessionTeraTerm for Windows can now log time as well but does not give elapsed time measurements.,Measuring Boot Time - Cont,Using the C program approach you will see o。

9、utput like:18.066 0.093: Thu Jun 28 11:56:00 UTC 2012INIT: Entering runlevel: 518.262 0.175: Starting system message bus: dbus.18.280 0.018: Starting Hardware abstraction layer hald19.474 1.194: Starting Dropbear SSH server: dropbear.19.499 0.025: Starting telnet daemon.19.538 0.039: Starting networ。

10、k benchmark server: netserver.19.569 0.031: Starting syslogd/klogd: done19.629 0.060: Starting thttpd.19.731 0.102: Starting PVR20.158 0.427: Starting Lighttpd Web Server: lighttpd.20.176 0.018: 2012-06-28 11:56:02: (log.c.166) server started In the above output you can see that starting the Dropbea。

11、r SSH server takes 1.194 seconds. If you do not need SSH you can save 1.194 seconds by disabling DropbearDisabling Dropbear is as simple as removing the S10dropbear init script from the /etc/rc5.d directory,Identifying the Boot Steps,One of the first things to help in optimizing boot time is to be a。

12、ble to recognize the markers indicating where a new part of the boot process startsSPLThe first newline character received on the serial console marks the start of SPLU-bootThe banner containing the U-boot version indicates the start of u-bootU-Boot 2011.09 (Jun 28 2012 - 11:20:36)Linux KernelFirst 。

13、line after the below line indicates the start of the Linux kernelUncompressing Linux done, booting the kernelFile SystemThe below line indicates the transition to the file system Init processINIT: version 2.86 booting,Profiling the Boot Loaders,There is no direct profiling support in the boot loader。

14、s, but the serial print times can still be very usefulFor example, when booting the kernel image you will see output like:5.335 0.010: # Booting kernel from Legacy Image at 80007fc0 .5.339 0.004: Image Name: Arago/3.2.0-psp04.06.00.08.sdk/a5.344 0.005: Image Type: ARM Linux Kernel Image (uncompresse。

15、d)5.348 0.004: Data Size: 3164688 Bytes = 3 MiB5.350 0.002: Load Address: 800080005.352 0.002: Entry Point: 800080006.273 0.921: Verifying Checksum . OK6.276 0.003: XIP Kernel Image . OK6.310 0.034: OKNotice that almost a second is spent verifying the kernel image checksum.If your system doesnt do a。

16、nything about a bad image, why spend time verifying it?This verification can be disabled by setting the “verify” u-boot parameter to n at the u-boot command promptu-boot# setenv verify n,Profiling the Linux Kernel,One of the simplest ways to profile the Linux kernel is to configure “CONFIG_PRINTK_TI。

17、ME” for the Linux kernel. On most recent kernels this is enabled by default.This adds the time since the kernel was booted in s before each line 2.029785 mmc1: card claims to support voltages below the defined range. T. 2.048583 mmc1: queuing unknown CIS tuple 0x91 (3 bytes) 2.055053 mmc1: new SDIO 。

18、card at address 0001 3.986724 PHY: 0:00 - Link is Up - 100/Full 4.015808 Sending DHCP requests ., OK 4.036254 IP-Config: Got DHCP answer from 0.0.0.0, my address is 128.247.10 4.044586 IP-Config: Complete: 4.047973 device=eth0, addr=128.247.105.20, mask=255.255.254.0, gw=12, 4.056182 host=128.247.10。

19、5.20, domain=am.dhcp.ti.com, nis-domain=(non, 4.063781 bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=In The above output we can see that it takes almost 2 seconds to get the network Phy Link up and obtain a DHCP IP address.Depending on network speed this could be longer. In the case where there i。

20、s no DHCP server this can take minutes to timeout.Setting “ip=off” in the bootargs will bypass kernel network configuration while still allowing you to configure the network in user space.setenv ip_method off,Profiling the Linux Kernel - Cont,Instrument kernel initialization. This will help you find。

21、 which static drivers in the kernel are taking the most time to initializeAdd “initcall_debug” to the bootargs in u-boot. With recent u-boots this can usually be done using:setenv optargs initcall_debugsaveenvWhen the Linux system is booted you can view these initcall lines using “dmesg | grep initc。

22、all” xxxxx initcall returned 0 after usecsThese lines can be sorted using the commands below to help find the modules with the largest init timesIf CONFIG_PRINTK_TIME is enableddmesg | grep initcall | sort -k8 -nIf CONFIG_PRINTK_TIME is not enableddmesg | grep initcall | sort -k6 -nIt is possible to。

23、 graphically view these initcall times using the bootgraph script in the Linux kernel sources. This requires CONFIG_PRINTK_TIME to be enabledcat | perl /scripts/bootgraph.pl boot.svgAdditionaly you can use other tools to help you analyze the Linux kernel such as:Linux Trace Toolkit (LTTng)Timing for。

24、 certain kernel and process eventsOprofileSystem wide profilerBootchartVisualizes boot process,Areas of Optimization,Optimizations generally fall into two areasSizeReduce the size of binariesRemove features not required to reduce component sizeSpeedOptimize for target processorNeon optimizationsUse 。

25、faster boot mediaNOR/NAND vs. MMC/USBReduce the number tasks leading to bootDo not check MMC if booting from NANDDo not initialize network if booting from MMCReduce initialization operationsDo not bring up network during boot if not requiredDo not start an SSH server on a device with no network,U-bo。

26、ot Optimization Techniques,Reduce environment size so that less data is read into memoryCONFIG_ENV_SIZERemove Unnecessary Console Print StatementsIn board config file add#define CONFIG_SILENT_CONSOLE 1In u-boot environment dosetenv silent 1Set “bootdelay” to 0Disable un-used peripherals such as USB/。

27、MMC/Ethernet/UARTModify the config file for your device in /include/configs. i.e am335x_evm.hAvoid long help text for the u-boot commands to save space#undef CONFIG_SYS_LONGHELPUse simple parser - instead of hush#undef CONFIG_SYS_HUSH_PARSERIf no USB/NAND/MMC/SPI/NOR(FLASH)#undef CONFIG_USB_*#undef 。

28、CONFIG_NAND#undef CONFIG_MMC#undef CONFIG_SPI#undef CONFIG_FLASH_*,U-boot Optimization Techniques - Cont,Remove -g option from the compilerOther IdeasDisable UART bootRemove Image Verification (covered before)Perhaps try uncompressed imageVerify that kernel image is read to the proper memory locatio。

29、n,Linux Optimization Techniques,Remove un-necessary drivers/features from kernel configurationReduces driver initialization timeReduces kernel sizeBuild non-fast boot drivers as modulesLoad them after the system is booted when there is more timeDisable console output using “quiet”Displaying messages。

30、 on console takes timeSetting the “quiet” option in the bootargs disables display on console but messages are still loggedu-boot# setenv optargs quietRemove un-used consoles. These take time to initialize.These can be removed in the /etc/inittab file on the target file systemIt is possible to comple。

31、tely disable printk but this will eliminate a lot of debug information,Linux Optimization Techniques - Cont,Defer module init callsIt is possibly to defer module init calls without having to build the modules dynamically. This requires modifying the kernelFor modules that are not needed at boot repl。

32、ace the “module_init()” function calls to “deferred_module_init()”Once the system booted the deferred calls can be executed by doing:echo 1 /proc/deferred_initcallsAdditional details at http:/elinux.org/Deferred_InitcallsRemove the -g option from the compileDisable kernel debugging featuresKernel de。

33、buggingDebug Filesystem (NOTE: Some features may need this)TracersRemove any instrumentation you may have added such as initcall instrumentation.,Linux Optimization Techniques - Cont,Pre-set loops per jiffyYou just need to measure this onceFind lpj value in kernel boot messagesCalibrating delay loop。

34、 718.02 BogoMIPS (lpj=3590144)Add the “lpj=3590144” to the bootargsUse Static IP addressing where possibleIf you dont need networking then disable it altogetherIf you want networking capability but not NFS then be sure to set “ip=off” on the kernel command line.Set memory limit with “mem=“ optionUse。

35、 only as much memory as needed to avoid DDR initialization time,File System Optimization Techniques,Use minimal BusyBox file systemReduces forking in shellBuild static of possible to reduce the need for un-used code in the file systemBe careful because static linking can also cause your file system 。

36、size to increase dramatically.Avoid using ramdisk or initramfsMust load entire ramdisk from flash into DDRMay only need a small part at boot timei.e. may not need all of glibc but entire library will be loaded into DDR using ramdisk or initramfsBuffer cache can keep frequently used files in memory,F。

37、ile System Optimization Techniques - Cont,Pre-linkingAvoid run time linking penaltyDrawback: If library changes app must be rebuilt.Use tmpfs file systemNo need to initialize file system for non-persistent dataUse split file systemsHave multiple file system partitionsPut only the files needed for bo。

38、ot in the root file system partitionPut other files in second file system which can be mounted after boot,File System Optimization Techniques - Cont,Strip executablesRemoves un-needed symbols and reduces sizeAvoid udev for static systemsIf the system doesnt change then make device nodes manually rat。

39、her than udev creating themHotplug-daemon can still run later to add additional devices that are plugged inDisable init scripts that start unneeded servicesUse GNU_HASH to make dynamic linking faster (This is the default for the SDK)Use systemd for parallel initialization,Credits/Sources,http:/processors.wiki.ti.com/index.php/Optimize_Linux_Boot_Timeby Sanjeev Premihttp:/elinux.org/Boot_Time,。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Clear Linux是一种基于Linux的操作系统,由英特尔公司开发和维护。它专注于提供高性能、安全性和可靠性,并采用了一些先进的技术,如透明使用大页、优化的内存管理和快速启动等。Clear Linux还提供了广泛的软件包和工具,以满足各种需求。 ### 回答2: Clear Linux是由Intel开发和维护的一种基于Linux操作系统的发行版。它的目标是提供一个专为性能优化和安全性设计的高度优化的操作系统。 Clear Linux的最大特点是其出色的性能。它采用了一系列优化技术和工具,如扁平的软件包堆栈、流行软件的最新版本、无多余依赖关系等,以减少资源使用和运行效率。这使得Clear Linux在计算密集型任务和高性能计算环境中表现出色,适合需要处理大量数据和科学计算的应用程序。 除了性能优化,Clear Linux还注重系统安全。它采用了一系列安全措施,如堆栈保护、内核防护和隔离等,以防止恶意软件和外部攻击对系统造成损害。同时,Clear Linux还提供了静态二进制文件,即它的软件包是预编译的,以减少潜在的漏洞风险。 另外,Clear Linux还有良好的易用性和灵活度。它提供了一个简单直观的命令行界面和功能丰富的软件中心,使用户可以方便地安装和管理软件。此外,Clear Linux还支持容器化和虚拟化技术,使其适用于各种应用场景和工作负载。 总之,Clear Linux是一种面向性能和安全性优化Linux发行版,具有出色的性能、较高的安全性、良好的易用性和灵活度。它适用于需要高性能和安全性的计算环境,并提供了丰富的工具和功能来满足用户的需求。 ### 回答3: Clear Linux是由英特尔开发的一款基于Linux的操作系统。它专注于提供高性能和优化的软件栈,以满足现代计算需求。 首先,Clear Linux具有极快的启动速度和响应速度。它采用了一种名为“特定硬件优化优先级”的技术,在启动过程中只加载必要的硬件驱动程序和组件,从而减少了启动时间。此外,它使用了一种名为“透明高速缓存”的技术来优化内存管理和数据访问,从而提高了系统的响应速度。 其次,Clear Linux提供了一系列面向性能的工具和库。它内置了英特尔的最新软件工具和技术,如英特尔优化器、英特尔数学库等,这些工具可以大大提升软件的运行速度和效率。此外,Clear Linux还提供了一系列针对特定硬件平台的优化,如英特尔处理器、英特尔网卡等,以进一步提高系统性能。 此外,Clear Linux还拥有强大的容器支持。它提供了一套完整的容器解决方案,包括容器运行时和容器管理工具,以便开发人员和运维人员能够更轻松地部署和管理容器。同时,Clear Linux还支持多种容器标准和格式,如Docker、Kubernetes等,以满足不同的容器需求。 总之,Clear Linux是一款专注于性能和优化Linux操作系统。它的快速启动速度、优化的软件工具和库,以及强大的容器支持,使其成为处理高性能计算和专业应用的理想选择。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值