View previous topic :: View next topic |
Author |
Message |
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sat Mar 02, 2013 2:55 pm Post subject: Speed up boot time. |
|
|
Hi,
I'm currently trying to speed up my OS boot time. I successfully decreased this time from ~15s to ~8s. I think I can still decrease it to 5s, or even 3s.
Considering dmesg, the next step is to speed up network startup:
Code: | Jelly ~ # dmesg|tail
[ 5.671331] XFS (dm-0): Mounting Filesystem
[ 5.765824] XFS (dm-0): Ending clean mount
[ 5.794860] XFS (dm-1): Mounting Filesystem
[ 5.897440] XFS (dm-1): Ending clean mount
[ 5.898202] mount (1689) used greatest stack depth: 4552 bytes left
[ 6.723073] 0000:04:00.0: Missing Free firmware
[ 6.724311] r8169 0000:04:00.0 eth0: unable to load firmware patch /*(DEBLOBBED)*/ (-22)
[ 6.735636] r8169 0000:04:00.0 eth0: link down
[ 6.735805] ip (1922) used greatest stack depth: 3576 bytes left
[ 8.688318] r8169 0000:04:00.0 eth0: link up |
It seams that an error occurred, delaying eth0 link up.
Code: | [ 6.723073] 0000:04:00.0: Missing Free firmware
[ 6.724311] r8169 0000:04:00.0 eth0: unable to load firmware patch /*(DEBLOBBED)*/ (-22) |
This probably due to the fact that r8169 is loaded before the rootfs is mounted.
Code: | Jelly ~ # dmesg|egrep "sda|r8169"
[ 0.000000] Command line: BOOT_IMAGE=/vanilla-3.8.1 rootfstype=xfs root=/dev/sda4
[ 0.000000] Kernel command line: BOOT_IMAGE=/vanilla-3.8.1 rootfstype=xfs root=/dev/sda4
[ 2.096111] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 2.096296] r8169 0000:04:00.0: irq 45 for MSI/MSI-X
[ 2.096464] r8169 0000:04:00.0 eth0: RTL8168evl/8111evl at 0xffffc90000056000, bc:5f:f4:67:05:1d, XID 0c900800 IRQ 45
[ 2.096473] r8169 0000:04:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[ 2.433806] sd 4:0:0:0: [sda] 117231408 512-byte logical blocks: (60.0 GB/55.8 GiB)
[ 2.434634] sd 4:0:0:0: [sda] Write Protect is off
[ 2.434974] sd 4:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 2.435003] sd 4:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 2.436665] sda: sda1 sda2 sda3 sda4
[ 2.437295] sd 4:0:0:0: [sda] Attached SCSI disk
[ 2.825591] XFS (sda4): Mounting Filesystem
[ 2.846112] XFS (sda4): Ending clean mount
[ 5.393080] Adding 8388604k swap on /dev/sda3. Priority:-1 extents:1 across:8388604k SS
[ 6.724311] r8169 0000:04:00.0 eth0: unable to load firmware patch /*(DEBLOBBED)*/ (-22)
[ 6.735636] r8169 0000:04:00.0 eth0: link down
[ 8.688318] r8169 0000:04:00.0 eth0: link up |
Why is it loaded in the wrong order? How can i fix this? Here is my whole dmesg. Any other idea?
Thanks in advance.
Edit. Just to point out:
Code: | Jelly ~ # zcat /proc/config.gz | grep R8169
CONFIG_R8169=y
Jelly ~ # lspci|grep Ethernet
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06) |
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54119 Location: 56N 3W
|
Posted: Sat Mar 02, 2013 3:20 pm Post subject: |
|
|
apinsard,
Drivers that need firmware must have both parts in the same place - either both in the kernel binary or both on the root filesystem.
A half and half mix fails.
The kernel for my diskless box, which also uses r1869 contains
Code: | (/sbin/hotplug) path to uevent helper
│ │[*] Maintain a devtmpfs filesystem to mount at /dev
│ │[*] Automount devtmpfs at /dev, after the kernel mounted the rootfs
│ │[*] Select only drivers that don't need compile-time external firmware
│ │[*] Prevent firmware from being built
│ │-*- Userspace firmware loading support
│ │[ ] Include in-kernel firmware blobs in kernel binary
│ │(rtl_nic/rtl8168e-2.fw radeon/PALM_pfp.bin radeon/PALM_me.bin radeon/SUMO_rlc.bin) External firmware blobs to build into the kernel binary
│ │(/lib/firmware/) Firmware blobs root directory | notice the rtl_nic/...
Without that boot is stalled for 60 sec.
I can't really make the network driver a module ... the box is diskless, so the network is needed to mount root.
I can't ell you what firmware you need. The filename is normally in dmesg but in your case, its not. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sat Mar 02, 2013 4:01 pm Post subject: |
|
|
I don't either have a /lib/firmware directory.
I'm also configuring my kernel from papy's seeds and not yet done. Maybe some settings are not currently well set?
Code: | Jelly ~ # zcat /proc/config.gz |egrep "FIRMWARE|FW"
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_FIRMWARE_EDID=y
# CONFIG_USB_ISIGHTFW is not set
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_GOOGLE_FIRMWARE is not set |
Code: | (/sbin/hotplug) path to uevent helper
│ │[*] Maintain a devtmpfs filesystem to mount at /dev
│ │[ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
│ │[*] Select only drivers that don't need compile-time external firmware
│ │[*] Prevent firmware from being built
│ │-*- Userspace firmware loading support
│ │[ ] Include in-kernel firmware blobs in kernel binary
│ │() External firmware blobs to build into the kernel binary
│ │[ ] Driver Core verbose debug messages
│ │[ ] Managed device resources verbose debug messages |
Edit. I read through CONFIG_FIRMWARE_IN_KERNEL's help and realized that I shall make firmware_install. I did and rebooted. I now have a /lib/firmware directory but none of these firmware seems related to Realtek. And I still have the error in dmesg.
Last edited by apinsard on Sat Mar 02, 2013 4:20 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21518
|
Posted: Sat Mar 02, 2013 4:20 pm Post subject: |
|
|
Based on that dmesg output, it looks like the kernel is one of the "-libre" forks that has little or no support for firmware designated by the -libre maintainers as non-Free. If so, and if the maintainers have designated the firmware for your card as non-Free, then you must either accept the lack of firmware or change to a non-libre kernel. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54119 Location: 56N 3W
|
Posted: Sat Mar 02, 2013 4:31 pm Post subject: |
|
|
apinsard,
I would expect the file you need to be in /lib/firmware/rtl_nic
Pappys seeds have all hardware setting off - you have to set your own.
This includes network card drivers and their firmware.
You may need to Code: | emerge linux-firmware | to populate /lib/firmware _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sat Mar 02, 2013 6:20 pm Post subject: |
|
|
I emerged linux-firmware but it didn't do anything :/
Actually, my ethernet connection works and the driver seems OK.
Code: | Jelly ~ # lspci -vs 04:00.0
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)
Subsystem: ASRock Incorporation Motherboard (one of many)
Flags: bus master, fast devsel, latency 0, IRQ 45
I/O ports at e800 [size=256]
Memory at fbfff000 (64-bit, prefetchable) [size=4K]
Memory at fbff8000 (64-bit, prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Capabilities: [d0] Vital Product Data
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
Kernel driver in use: r8169 |
I just have this issue at boot time.
Edit. Maybe I'd be better finish configure properly my kernel before trying to speed up my boot time? |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sun Mar 03, 2013 8:14 pm Post subject: |
|
|
I tried every rtl8168* firmwares in /lib/firmware/rtl_nic/ but none of them worked without r8169.
It seems that r8169 is the only right driver, but why do I have errors though it works? And above all, how can I get rid of them? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54119 Location: 56N 3W
|
Posted: Sun Mar 03, 2013 8:21 pm Post subject: |
|
|
apinsard,
r8169 is a kernel driver for a series of Realtek network interfaces.
The firmware helps it along.
You need both the r8169 and its firmware. Many instances of r8169 work without the firmware. Yours and mine included.
What does Code: | emerge gentoo-sources -pv | show on your system? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sun Mar 03, 2013 8:42 pm Post subject: |
|
|
Code: | # emerge -pv gentoo-sources
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N ] sys-kernel/gentoo-sources-3.8.1:3.8.1 USE="-build -deblob -symlink" 79 kB
Total: 1 package (1 new), Size of downloads: 79 kB |
But I'm using vanilla-sources. So you might be more interested in the following I believe:
Code: | # emerge -pv vanilla-sources
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] sys-kernel/vanilla-sources-3.8.1:3.8.1 USE="deblob symlink -build" 0 kB
Total: 1 package (1 reinstall), Size of downloads: 0 kB |
I get a few more information in dmesg by enabling DEBUG_DRIVERS and DEBUG_DEVRES:
Code: | # dmesg|tail
[ 4.744554] 0000:04:00.0: Missing Free firmware
[ 4.744557] __allocate_fw_buf: fw-/*(DEBLOBBED)*/ buf=ffff880132420900
[ 4.745040] device: '!*(DEBLOBBED)*!': device_add
[ 4.745053] firmware !*(DEBLOBBED)*!: firmware: requesting /*(DEBLOBBED)*/
[ 4.746276] fw_set_page_data: fw-/*(DEBLOBBED)*/ buf=ffff880132420900 data= (null) size=0
[ 4.746303] __fw_free_buf: fw-/*(DEBLOBBED)*/ buf=ffff880132420900 data= (null) size=0
[ 4.746307] r8169 0000:04:00.0 eth0: unable to load firmware patch /*(DEBLOBBED)*/ (-22)
[ 4.759640] r8169 0000:04:00.0 eth0: link down
[ 4.759832] ip (1902) used greatest stack depth: 2696 bytes left
[ 6.545832] r8169 0000:04:00.0 eth0: link up |
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54119 Location: 56N 3W
|
Posted: Sun Mar 03, 2013 8:54 pm Post subject: |
|
|
apinsard,
Unless you really really want deblob, set USE=-deblob.
That will leave some firmware in the kernel.
Remerge your kernel, so you get the embedded firmware then rebuild your kernel starting with _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sun Mar 03, 2013 9:32 pm Post subject: |
|
|
@apinsard,
it seems we have the same NIC and maybe the same mainboard. Mine is an AsRock Z77 Pro4.
Quote: | lspci -vs 04:00.0
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)
Subsystem: ASRock Incorporation Motherboard (one of many)
Flags: bus master, fast devsel, latency 0, IRQ 44
I/O ports at e000 [size=256]
Memory at f0004000 (64-bit, prefetchable) [size=4K]
Memory at f0000000 (64-bit, prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: r8169 |
and dmesg
Quote: | dmesg|egrep r8169
[ 1.653576] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 1.653802] r8169 0000:04:00.0: irq 44 for MSI/MSI-X
[ 1.653895] r8169 0000:04:00.0 eth0: RTL8168evl/8111evl at 0xffffc9000005c000, bc:5f:f4:51:3e:84, XID 0c900800 IRQ 44
[ 1.653897] r8169 0000:04:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[ 3.337721] r8169 0000:04:00.0 eth0: link down
[ 5.148423] r8169 0000:04:00.0 eth0: link up |
Does your config really looks like this ?
Quote: | (rtl_nic/rtl8168d-1.fw) External firmware blobs to build into the kernel binary
(/lib/firmware/) Firmware blobs root directory | I mine, exactly like this?
If so, it should work.
Alternativly you can install r8168.
Quote: | emerge net-misc/r8168 |
You have to switch off
Quote: | < > Realtek 8169 gigabit ethernet support |
This expected Quote: | emerge @module-rebuild | with each new kernel.
Jean-Paul |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sun Mar 03, 2013 9:36 pm Post subject: |
|
|
Indeed, it solved the issue. But does this mean that I have non-free pieces now? I don't like having non-free software, matter of principle...
Just another question: What means this kind of lines in dmesg?
Code: | [ 2.361778] kbd_mode (1162) used greatest stack depth: 5864 bytes left
[ 2.373653] loadkeys (1163) used greatest stack depth: 5240 bytes left
[ 2.374603] init-early.sh (1161) used greatest stack depth: 5016 bytes left
[ 2.729523] blkid (1414) used greatest stack depth: 4904 bytes left
[ 4.312236] runscript.sh (1629) used greatest stack depth: 4712 bytes left
[ 4.805515] mount (1666) used greatest stack depth: 4552 bytes left
[ 5.528345] ip (1899) used greatest stack depth: 2808 bytes left |
Can I fix these warnings? Would it take me any benefit? |
|
Back to top |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sun Mar 03, 2013 10:01 pm Post subject: |
|
|
Yes, this means you have non-free software installed - just like nvidia
apinsard wrote: | What means this kind of lines in dmesg? |
You've enabled debugging output in your kernel (CONFIG_DEBUG_STACK_USAGE)
Jean-Paul |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sun Mar 03, 2013 10:06 pm Post subject: |
|
|
Jean-Paul wrote: | Yes, this means you have non-free software installed - just like nvidia |
Nope, I use the "nouveau" driver.
Jean-Paul wrote: |
apinsard wrote: | What means this kind of lines in dmesg? |
You've enabled debugging output in your kernel (CONFIG_DEBUG_STACK_USAGE)
Jean-Paul |
Yep I just saw that. I think it is also due to CONFIG_FRAME_WARN = 2048 |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Sun Mar 03, 2013 10:32 pm Post subject: |
|
|
i hope you used JFS for your /boot, ext is painfully slow. give systemd a whirl. id say its about 8 times faster than openrc, and about 4/5ths as functional. so long as your not running apache your good. |
|
Back to top |
|
|
apinsard n00b
Joined: 24 Mar 2012 Posts: 74 Location: France
|
Posted: Sun Mar 03, 2013 10:36 pm Post subject: |
|
|
666threesixes666 wrote: | i hope you used JFS for your /boot, ext is painfully slow. give systemd a whirl. id say its about 8 times faster than openrc, and about 4/5ths as functional. so long as your not running apache your good. |
Nope, I use ext2. Thanks, I will check JFS out. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21518
|
Posted: Mon Mar 04, 2013 12:40 am Post subject: |
|
|
666threesixes666 wrote: | i hope you used JFS for your /boot, ext is painfully slow. give systemd a whirl. id say its about 8 times faster than openrc, and about 4/5ths as functional. so long as your not running apache your good. | Given how little /boot is used by most people, it seems highly unlikely that the choice of filesystem will matter much. Citations on both the speed claim and the Apache reference would be welcome. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Mar 13, 2013 1:50 am Post subject: |
|
|
hu... http://en.gentoo-wiki.com/wiki/Systemd
notice no apache start script.... (if you dont need apache, systemd is extremely fast)
and as for JFS vs EXT
http://forums.anandtech.com/showthread.php?t=1144811
ext2 with out journal is faster, for large file writes, but not for fscking. to fsck a journaled JFS tb drive takes around a minute, to fsck a ext(2,3,4) takes around an hour, and the file system starts to freak out once its excessively used. XFS you can not use for a /boot drive, i use XFS as a /, but its being reverted back to JFS because of XFS's poor error handling. needless to say EXT is not an option i refuse to use it. i might go back to ext2 for more testing if they fix the fsck times. |
|
Back to top |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3264 Location: Canada
|
Posted: Wed Mar 13, 2013 5:26 am Post subject: |
|
|
666threesixes666 wrote: | hu... http://en.gentoo-wiki.com/wiki/Systemd
notice no apache start script.... (if you dont need apache, systemd is extremely fast)
and as for JFS vs EXT
http://forums.anandtech.com/showthread.php?t=1144811
ext2 with out journal is faster, for large file writes, but not for fscking. to fsck a journaled JFS tb drive takes around a minute, to fsck a ext(2,3,4) takes around an hour, and the file system starts to freak out once its excessively used. XFS you can not use for a /boot drive, i use XFS as a /, but its being reverted back to JFS because of XFS's poor error handling. needless to say EXT is not an option i refuse to use it. i might go back to ext2 for more testing if they fix the fsck times. |
How are you even managing to corrupt /boot to need fsck on it ? And I hope it is not a terabyte partition |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Wed Mar 13, 2013 1:10 pm Post subject: |
|
|
666threesixes666 wrote: | needless to say EXT is not an option i refuse to use it. |
I don't think it's "needless to say". Extraordinary claims require extraordinary evidence. I've had satisfactory experience with EXT for over almost 2 decades, ext2, ext3, and now ext4. In normal use my problems have been sufficiently small to not rise to notice, now. I have had problems with "abnormal use", but I don't believe that counts. Also based on sound advice, I'm using XFS for my MythTV partition, simply because of its different characteristics, and have been happy with that, as well.
Right now ext4 is the "default" filesystem, and to make such an accusation is pretty stern stuff. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
mir3x Guru
Joined: 02 Jun 2012 Posts: 455
|
|
Back to top |
|
|
py-ro Veteran
Joined: 24 Sep 2002 Posts: 1734 Location: Velbert
|
Posted: Wed Mar 13, 2013 6:42 pm Post subject: |
|
|
Systemd boots my notebook in 3s from grub, openrc needs 10s.
Booth to KDE-Desktop. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Mar 13, 2013 6:50 pm Post subject: |
|
|
http://freedesktop.org/wiki/Software/systemd/Optimizations
i learned of systemd from personally knowing the HA clustering people @ linbit.com / drbd.org i had taught linux from scratch to one of them approximately 4 years ago. systemd is not industrial grade yet for gentoo, but you can still preview it. arch full on requires systemd. freedesktop does not lie like tinfoil hat wordpressers do.
"xfs boot time"
XFS: 12.40 seconds
xfs cannot be used as /boot, your website is invalid. i say JFS from experience, not numbers.... BTRFS is untested from me yet, the HA clustering people will fill me in on it in a bit though. as for the JFS though, ive punished it absurdly with power outages tons of media hoarding formats so on so forth and its definitely the absolute best linux file system ive found so far. ive also not tested ZFS, tough that seems more of a raid storage type fs rather than a /boot & / fs
similar experience with systemd, 2 seconds instead of 20, but i serve apache periodically so im stuck to openrc for the moment.
Last edited by 666threesixes666 on Wed Mar 13, 2013 6:59 pm; edited 1 time in total |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Wed Mar 13, 2013 6:58 pm Post subject: |
|
|
Hmm... systemd literally killed my arch laptop install, so I would be extremely wary of it. After installing systemd on gentoo my boot time at least doubled. Openrc takes about 2-3 seconds on my system once the process is handed off to init from my initramfs. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Mar 13, 2013 7:02 pm Post subject: |
|
|
systemd is new and touchy. i can get it to boot very well with a few exceptions, the 1 that is keeping me from going systemd only is apache. i have to use GDM for gnome or else i lose menus. |
|
Back to top |
|
|
|