On Wednesday, 19 May, 2021 at 10:07:53 pm UTC+5:30 [email protected] 
wrote:

> Hi Amit,
>
> Interesting.  4.19.94 is a only a little bit faster than 4.14.108.  Is 
> there a document somewhere that explains what to do to even just speed up 
> both start up and shut down?
>
> What did you do to get it to 50 seconds?
>
>  
>
> John
>
> Hi John,

I did not do much actually to get to 50s.
Started from  a console Image : 
https://rcn-ee.com/rootfs/bb.org/testing/2020-05-02/stretch-console/bone-eMMC-flasher-debian-9.12-console-armhf-2020-05-02-1gb.img.xz
 replaced the kernel:

cd /opt/scripts/tools/

sudo su

git pull

./update_kernel.sh --ti-rt-channel --lts-4_19

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
          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
           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
           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.

-amit

>  
>
>  
>
> debian@ebb:~$ uname -a
>
> Linux ebb 4.14.108-ti-r136 #1stretch SMP PREEMPT Mon Jun 8 15:38:30 UTC 
> 2020 armv7l GNU/Linux
>
>  
>
> debian@ebb:~$ systemd-analyze
>
> Startup finished in 40.059s (kernel) + 1min 27.889s (userspace) = 2min 
> 7.948s
>
>  
>
> debian@ebb:~$ systemd-analyze blame
>
>     1min 47.177s dev-mmcblk0p1.device
>
>     1min 13.819s generic-board-startup.service
>
>  
>
> debian@beaglebone:~$ uname -a
>
> Linux beaglebone 4.19.94-ti-r63 #1buster SMP PREEMPT Fri May 14 16:42:32 
> UTC 2021 armv7l GNU/Linux
>
>  
>
> debian@beaglebone:~$ systemd-analyze
>
> Startup finished in 26.608s (kernel) + 1min 32.506s (userspace) = 1min 
> 59.114s
>
> graphical.target reached after 1min 32.205s in userspace
>
>  
>
> debian@beaglebone:~$ systemd-analyze blame
>
>     1min 20.997s generic-board-startup.service
>
>      1min 4.519s dev-mmcblk0p1.device
>
>          11.344s udisks2.service
>
>  
>
> *From:* [email protected] [mailto:[email protected]] *On 
> Behalf Of *Amit Goradia
> *Sent:* May-19-21 12:00 AM
> *To:* BeagleBoard
> *Subject:* Re: [beagleboard] Reducing Boottime in Beaglebone Black
>
>  
>
> Hi Robert,
>
> Awesome work with the Beaglebone OS and tools. Entry point for a beginier 
> is so much simplified using the tools you provide.
>
> I know this topic is OLD.
>
> I have been trying to get my boot times with a BBB down from about 50s to 
> 20s
>
> I have started with a Debian Stretch 9.12 console image. Upgraded it to 
> realtime kernel 4.19. Booting from EMMC.
>
> Trying to get a single console app or X11 app open in less than 20-25s
>
> This is my output for systemd-analyze blame
>
>  
>
> debian@beaglebone:~$ systemd-analyze
>
> Startup finished in 1.690s (kernel) + 50.841s (userspace) = 52.532s
>
> debian@beaglebone:~$ systemd-analyze blame
>
>     1min 15.560s dev-mmcblk1p1.device
>
>           8.459s generic-board-startup.service
>
>           4.654s systemd-udev-trigger.service
>
>           3.188s loadcpufreq.service
>
>           2.620s networking.service
>
>           2.157s keyboard-setup.service
>
>           1.791s systemd-logind.service
>
>           1.711s dnsmasq.service
>
>           1.631s ssh.service
>
>           1.529s rsyslog.service
>
>           1.429s [email protected]
>
>           1.418s systemd-journald.service
>
>           1.204s cpufrequtils.service
>
>           1.071s systemd-timesyncd.service
>
>            918ms systemd-fsck-root.service
>
>            597ms systemd-udevd.service
>
>            528ms dev-mqueue.mount
>
>            515ms sys-kernel-debug.mount
>
>            495ms systemd-tmpfiles-setup-dev.service
>
>            469ms systemd-tmpfiles-setup.service
>
>            451ms systemd-sysctl.service
>
>            417ms systemd-modules-load.service
>
>            400ms systemd-user-sessions.service
>
>            388ms sys-fs-fuse-connections.mount
>
>            369ms systemd-journal-flush.service
>
>            355ms slim.service
>
>            324ms systemd-update-utmp.service
>
>            311ms sys-kernel-config.mount
>
>            303ms kmod-static-nodes.service
>
>            300ms systemd-remount-fs.service
>
>            238ms console-setup.service
>
>            210ms systemd-random-seed.service
>
>            140ms systemd-update-utmp-runlevel.service
>
> debian@beaglebone:~$ uname -a
>
> Linux beaglebone 4.19.94-ti-rt-r63 #1stretch SMP PREEMPT RT Fri May 14 
> 16:42:35 UTC 2021 armv7l GNU/Linux
>
>  
>
> Any advise you can give to reduce the userspace time further?
>
> IT would be really helpful if you could list the optimizations you did for 
> the  FLIR demo app.
>
>  
>
> Regards,
>
> amit
>
>  
>
> On Monday, 16 July, 2018 at 8:35:57 pm UTC+5:30 RobertCNelson wrote:
>
> On Mon, Jul 16, 2018 at 10:01 AM, sajeevan k <[email protected]> wrote: 
> > 
> > Hi Robert Nelson, Dennis Lee & Daniel Kulp, 
> > 
> > 
> > Thank You very much for the reply and support. 
> > 
> > I have been little busy with some other tasks. So I couldn't test with 
> the 
> > iot image. 
> > I am hopeful in the idea of starting from iot image and build up from 
> it. 
> > 
> > Will the fix for CVE-2018-1108, affect the normal booting of Beaglebone 
> > black? Is there a chance that normal applications access random data at 
> boot 
> > time? 
>
> Even with the fix for that CVE, v4.14.x is still faster then v4.9.x.. 
> It just use to be 'way' faster.. 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>
> -- 
> 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/989d9ca9-b8c8-424d-a88a-62cac4d4cc36n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/beagleboard/989d9ca9-b8c8-424d-a88a-62cac4d4cc36n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/fde7a746-4ae2-41c8-aa2b-3791e534a176n%40googlegroups.com.

Reply via email to