Hi
I am working for the boot time optimization for the beagle bone green
wireless board
Now with some above mentioned suggestions, I am able to reduce the boot
time from 90 sec to 45 sec.
But I want to further reduce it to 30 sec.
Please guide me the further points where I can optimize it.
The current detail of my board is as below
Startup finished in 4.295s (kernel) + 38.147s (userspace) = 42.442s
ubuntu@arm:~$ systemd-analyze -blaim
systemd-analyze: invalid option -- 'b'
ubuntu@arm:~$ systemd-analyze blame
25.275s console-setup.service
17.904s dev-mmcblk1p1.device
15.945s postfix.service
12.165s generic-board-startup.service
8.654s apache2.service
7.635s systemd-logind.service
6.160s avahi-daemon.service
5.594s systemd-hwdb-update.service
5.568s ondemand.service
5.432s loadcpufreq.service
4.968s bb-wl18xx-bluetooth.service
4.578s led-status.service
3.547s networking.service
2.981s capemgr.service
2.412s hostapd.service
2.389s rsyslog.service
2.073s cpufrequtils.service
1.535s ssh.service
1.477s systemd-user-sessions.service
1.389s pppd-dns.service
1.151s systemd-udev-trigger.service
1.040s archive_log.service
1.011s systemd-journal-flush.service
979ms rc-local.service
860ms brltty.service
653ms keyboard-setup.service
629ms systemd-journald.service
609ms tacread-keymap.service
499ms rename-bluetooth-hardware.service
494ms systemd-update-utmp.service
462ms systemd-udevd.service
451ms resolvconf.service
437ms dev-mqueue.mount
437ms sys-kernel-debug.mount
Thanks
Karishma Jaiswal
On Friday, May 21, 2021 at 3:55:32 PM UTC+5:30 Amit Goradia wrote:
> Hi Robert,
> I just realized that I need to use an overlayfs (via overlayroot) to
> protect the emmc / OS from crashing on sudden power off.
> Now overlaytroot needs the initrd image to work.
> So I had to enable the /boot/initrd.img-4.19.94-ti-rt-r63 file.
> Re-enablingthe initird file in /boot added about 48 to 50s to the kernel
> boot time ;-(
> Any ideas on how to mitigate that? how to get the booting time down?
> Thanks & Regards,
> -amit
>
> debian@beaglebone:/$ systemd-analyze
> Startup finished in 58.454s (kernel) + 49.641s (userspace) = 1min 48.096s
> debian@beaglebone:/$ systemd-analyze blame
> 1min 21.167s dev-mmcblk1p1.device
> 10.477s generic-board-startup.service
> 5.278s systemd-udev-trigger.service
> 2.907s networking.service
> 2.684s ssh.service
> 2.328s keyboard-setup.service
> 1.940s dnsmasq.service
> 1.661s systemd-journald.service
> 1.101s systemd-user-sessions.service
> 895ms systemd-udevd.service
> 845ms [email protected]
> 785ms systemd-random-seed.service
> 766ms systemd-timesyncd.service
> 754ms systemd-tmpfiles-setup-dev.service
> 725ms systemd-modules-load.service
> 670ms systemd-update-utmp.service
> 657ms systemd-logind.service
> 645ms sys-kernel-config.mount
> 641ms sys-kernel-debug.mount
> 603ms systemd-tmpfiles-setup.service
> 572ms kmod-static-nodes.service
> 518ms rsyslog.service
> 515ms systemd-sysctl.service
> 408ms systemd-remount-fs.service
> 358ms slim.service
> 351ms console-setup.service
> 324ms systemd-journal-flush.service
> 280ms sys-fs-fuse-connections.mount
> 272ms systemd-tmpfiles-clean.service
> 228ms systemd-update-utmp-runlevel.service
> 223ms dev-mqueue.mount
>
> On Friday, 21 May, 2021 at 12:32:08 pm UTC+5:30 Amit Goradia wrote:
>
>> On Thursday, 20 May, 2021 at 11:01:42 pm UTC+5:30 RobertCNelson wrote:
>>
>>> > removed wpasupplicant and connman and old kernel
>>> >
>>> > sudo apt-get purge linux-image-4.14.108-ti-r134 wpasupplicant connman
>>> >
>>> > debian@beaglebone:~$ systemd-analyze
>>> >
>>> > Startup finished in 13.502s (kernel) + 36.686s (userspace) = 50.188s
>>> >
>>> > I then removed the initrd file in /boot directory (From what I
>>> understand this kernel does not necessarily need initrd).
>>> > debian@beaglebone:/boot$ sudo mv initrd.img-4.19.94-ti-rt-r63
>>> moved-initrd.img-4.19.94-ti-rt-r63
>>> >
>>> > Removing the initrd gives the max speedup for kernel. From 10s-13s
>>> with initrd, it reduces to 1s-2s
>>> > debian@beaglebone:~$ systemd-analyze
>>> > Startup finished in 1.663s (kernel) + 36.385s (userspace) = 38.048s
>>> > debian@beaglebone:~$ systemd-analyze blame
>>> > 1min 4.266s dev-mmcblk1p1.device
>>> > 26.360s generic-board-startup.service
>>> > 3.847s systemd-udev-trigger.service
>>> > 2.824s loadcpufreq.service
>>>
>>> You can nuke this ^, it's really only for am57xx, so we can
>>> downclock.. But on am335x, let it run at full speed as these are set:
>>>
>>> CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
>>> CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
>>>
>>> > 2.215s networking.service
>>> > 1.647s ssh.service
>>> > 1.396s [email protected]
>>> > 1.209s rsyslog.service
>>> > 1.189s systemd-journald.service
>>> > 999ms dnsmasq.service
>>> > 897ms cpufrequtils.service
>>>
>>> Same as above..
>>>
>>> > 855ms systemd-timesyncd.service
>>> > 674ms systemd-fsck-root.service
>>> > 642ms systemd-logind.service
>>> > 505ms systemd-udevd.service
>>> > 445ms systemd-user-sessions.service
>>> > 408ms systemd-tmpfiles-setup-dev.service
>>> > 389ms systemd-update-utmp.service
>>> > 375ms hostapd.service
>>>
>>> You nuked wpasupplicant, get rid of hostapd..
>>>
>>> > 365ms systemd-modules-load.service
>>> > 326ms dev-mqueue.mount
>>> > 324ms systemd-random-seed.service
>>> > 312ms sys-kernel-config.mount
>>> > 291ms systemd-tmpfiles-setup.service
>>> > 274ms sys-kernel-debug.mount
>>> > 236ms kmod-static-nodes.service
>>> > 231ms sys-fs-fuse-connections.mount
>>> > 200ms systemd-remount-fs.service
>>> > 190ms systemd-journal-flush.service
>>> > 185ms systemd-sysctl.service
>>> > 145ms systemd-update-utmp-runlevel.service
>>> > 130ms systemd-tmpfiles-clean.service
>>> >
>>> > Next point to attack is the generic-board-startup.service. The main
>>> time that process spends is in the file /opt/scripts/boot/am335x_evm.sh
>>> > This takes care of the USB flash, Serial and network gadgets that are
>>> initialized. Remove items which are not needed. It also has a lot of
>>> generic selections for Beagle family boards which can be removed. I am
>>> working on my version for just beaglebone black with only network over USB
>>> support.
>>> > Some ideas can be found here (
>>> https://github.com/RobertCNelson/boot-scripts/issues/10)
>>> >
>>> > Hope that helps.
>>>
>>> --
>>> Robert Nelson
>>> https://rcn-ee.com/
>>
>>
>>
>> Thanks a lot Robert. Your help is most appreciated.
>> I have implemented your suggestions and removed the following services
>> loadcpufreq.service
>> cpufrequtils.service
>> hostapd.service
>> My current boot time still ranges between 48s to 52s
>>
>> debian@beaglebone:~$ systemd-analyze
>> Startup finished in 1.751s (kernel) + 48.369s (userspace) = 50.120s
>> debian@beaglebone:~$ systemd-analyze blame
>> 1min 14.318s dev-mmcblk1p1.device
>> 9.419s generic-board-startup.service
>> 5.353s systemd-udev-trigger.service
>> 2.470s keyboard-setup.service
>> 2.438s networking.service
>> 2.423s ssh.service
>> 2.161s dnsmasq.service
>> 1.718s systemd-logind.service
>> 1.613s systemd-journald.service
>> 1.018s systemd-timesyncd.service
>> 969ms systemd-fsck-root.service
>> 730ms systemd-udevd.service
>> 595ms [email protected]
>> 589ms rsyslog.service
>> 549ms slim.service
>> 500ms sys-kernel-debug.mount
>> 488ms systemd-tmpfiles-setup-dev.service
>> 479ms systemd-update-utmp.service
>> 469ms dev-mqueue.mount
>> 456ms systemd-sysctl.service
>> 451ms systemd-tmpfiles-setup.service
>> 384ms systemd-modules-load.service
>> 380ms sys-kernel-config.mount
>> 352ms systemd-journal-flush.service
>> 344ms systemd-user-sessions.service
>> 319ms systemd-update-utmp-runlevel.service
>> 310ms systemd-random-seed.service
>> 284ms kmod-static-nodes.service
>> 257ms sys-fs-fuse-connections.mount
>> 250ms systemd-remount-fs.service
>> 227ms console-setup.service
>>
>> Any suggestions to bring it down further?
>> I am using a X desktop with slim as the login manager with autologin on
>> LCD.
>> From the generic board startup services, I am using network over USB (not
>> the serial over USB and flash over USB) parts.
>> What else should I be able to nuke to get the time faster?
>>
>> Regards,
>> -amit
>>
>>
>>
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/ffe212a0-0c11-4878-8662-8e55eee72738n%40googlegroups.com.