| View previous topic :: View next topic |
| Author |
Message |
mreff555 n00b

Joined: 10 Mar 2011 Posts: 72
|
Posted: Sun Nov 04, 2012 2:10 pm Post subject: Kernel size |
|
|
My dailyuse laptop kernel which is extramely functional, but in my optinion, fairly stripped down is 3.5M compressed or 5.5M uncompressed.
What can I compare this to. is this kernel small medium large?
I've hunted around on the internet and while there are plenty of guides on how to shrink your kernel. none really give a target.
how small is small? |
|
| Back to top |
|
 |
genstorm Advocate


Joined: 05 Apr 2007 Posts: 2251 Location: Austria
|
Posted: Sun Nov 04, 2012 2:13 pm Post subject: |
|
|
It's reasonably small.
Actually quite similar to mine, LZO compressed:
| Code: | 3,4M /boot/kernel-3.6.5-ownage
4,8M /lib/modules/3.6.5-ownage |
Look here: http://forums.gentoo.org/viewtopic-t-940702.html _________________ backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic |
|
| Back to top |
|
 |
mreff555 n00b

Joined: 10 Mar 2011 Posts: 72
|
Posted: Sun Nov 04, 2012 2:43 pm Post subject: |
|
|
I used xz compression because it seemed to be a good balance of speed and compression ratio.
At this point it's pretty os specific. The only other changes I could see making would be to remove some of the kernel hacking options like printk
or to internalize certain modules. such as ath9k, udf. Does that actually improve kernel size if you are able to turn off loadable modules? |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7679
|
Posted: Sun Nov 04, 2012 4:56 pm Post subject: |
|
|
| mreff555 wrote: | | Does that actually improve kernel size if you are able to turn off loadable modules? | The kernel module loading code is only needed if you support loadable modules, so in theory, yes, disabling module support can reduce the size of the kernel binary. It may not be reduced by a large amount, and it could be a net loss if disabling module support forces you to include rarely used code in the core image instead of placing it in an unloaded module. |
|
| Back to top |
|
 |
mreff555 n00b

Joined: 10 Mar 2011 Posts: 72
|
Posted: Sun Nov 04, 2012 8:15 pm Post subject: |
|
|
Just to see what would happen I updated my kernel config, adjusted every module I could find to compile in to the kernel
I've been running on it for a few hours. lsmod confirms I have no modules loaded. wireless seems to be fine.
The only problem I've noticed is that 1-wire functionality seems to have stopped since I switched it to a module (battery monitor)
I'll have to play with that one.
anyway, my kernel size increased from compressed 3.5 to 3.7. If I removed loadable modules would it drop my kernel size be more than .2M or would it be better to just go back to a couple loadable modules. |
|
| Back to top |
|
 |
cach0rr0 Moderator


Joined: 13 Nov 2008 Posts: 4117 Location: Houston, Republic of Texas
|
Posted: Sun Nov 04, 2012 10:39 pm Post subject: |
|
|
if you're dealing with wireless, i would lean heavily towards at the very least having wireless handled via modules
as kernel releases go, wireless seems to regularly shit the bed from one release to the next. In my case, with iwlwifi, I run into situations where iwlwifi segfaults, and my only recourse is to either reboot the machine, or, much more desirable, rmmod and modprobe (trying out different parameters/args from modinfo, some of which seem to have help).
sound cards are another one. Being able to pass args to modprobe is much easier than having to specify a bunch of crap on the kernel command line.
becomes almost a philosophical discussion of "to module, or not to module". For laptops, i lean module. For servers, i tend to have everything built in.
FWIW, my kernel is 4.0M, gzipped, my modules are 4.2M. I don't really notice any superfluous bloat. _________________ Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash |
|
| Back to top |
|
 |
mreff555 n00b

Joined: 10 Mar 2011 Posts: 72
|
Posted: Sat Nov 10, 2012 2:24 am Post subject: |
|
|
Yep, for now I've decided leaving some drivers such as wireless and video is definitely the best.
I did some more tweaking and I'm down to 3.4 compressed or 5.4 uncompressed. Removing loadable modules and building in my wifi and video cards pushes the uncompressed size up to 6.8megs |
|
| Back to top |
|
 |
wagglet n00b


Joined: 12 Oct 2012 Posts: 4 Location: Rotorua, New Zealand
|
Posted: Sat Nov 10, 2012 9:15 am Post subject: |
|
|
I'm running an almost-monolithic kernel on my venerable-but-oh-so-reliable ThinkPad and since the upgrade from 3.3.8 to 3.5.7 I have to say it seems just a little snappier. I did notice a moderate size increase between the versions: it's gone up around 300K but I still think it is a reasonable size given very nearly everything is compiled-in (including WiFi firmware):-
Kernel (gzip compressed):-
| Code: |
-rw-r--r-- 1 root root 934K Nov 10 14:55 initramfs-genkernel-x86-3.5.7-gentoo
-rw-r--r-- 1 root root 5.0M Nov 10 14:46 kernel-linux-3.5.7-gentoo
|
Modules usually running:-
| Code: |
Module Size Used by
vboxnetadp 18790 0
vboxnetflt 15965 0
vboxdrv 191664 2 vboxnetadp,vboxnetflt
hdaps 6344 1
tp_smapi 12500 0
thinkpad_ec 3907 2 hdaps,tp_smapi
scsi_wait_scan 483 0
|
I have no complaints so far...seems stable as a rock. Perhaps my standards are too low lol  |
|
| Back to top |
|
 |
mconnolly n00b

Joined: 10 Nov 2012 Posts: 3 Location: Altamonte Springs, FL
|
Posted: Sat Nov 10, 2012 3:37 pm Post subject: |
|
|
My kernel is set up to be entirely monolithic (no modules loaded), and right now the kernel is 4MB, XZ compressed (version 3.6.6). I am going to tweak it some more, as I know I haven't done all the optimization I can. It's almost there, though.
Boot up is very quick (<10 seconds) and it's very snappy, although I have a SATA3 SSD in my computer so that's most of it there, I am sure. |
|
| Back to top |
|
 |
mreff555 n00b

Joined: 10 Mar 2011 Posts: 72
|
Posted: Wed Nov 14, 2012 4:11 am Post subject: |
|
|
| mconnolly wrote: | My kernel is set up to be entirely monolithic (no modules loaded), and right now the kernel is 4MB, XZ compressed (version 3.6.6). I am going to tweak it some more, as I know I haven't done all the optimization I can. It's almost there, though.
Boot up is very quick (<10 seconds) and it's very snappy, although I have a SATA3 SSD in my computer so that's most of it there, I am sure. |
Impressive. I'm curious to know what you have removed. I'm not really sure what I could remove without sacrificing daily performance. What if any kernel hacking have you done?
here is mine
compressed and uncompressed kernel
| Code: |
-rw-r--r-- 1 root root 3.5M Nov 7 20:08 /boot/vmlinuz-3.6.6-build5
-rwxr-xr-x 1 root root 5.5M Nov 7 19:55 /usr/src/linux/arch/x86/boot/compressed/vmlinux
|
Typical modules loaded
| Code: |
Module Size Used by
i915 479963 2
drm_kms_helper 24749 1 i915
intel_agp 10432 1 i915
ath9k 148831 0
ath9k_common 1834 1 ath9k
ath9k_hw 382901 2 ath9k,ath9k_common
ath 15242 3 ath9k,ath9k_common,ath9k_hw
intel_gtt 15069 2 i915,intel_agp
coretemp 5862 0
mxm_wmi 1305 0
|
|
|
| Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2166 Location: Canada
|
Posted: Wed Nov 14, 2012 6:31 am Post subject: |
|
|
| Well, kernel size is continously growing. Mine has reached 2.6 Mb, I remember how it started crossing 2Mb somewhere around 2.6.32 |
|
| Back to top |
|
 |
|