[SOLVED] generic kernel for -currrent with 8GB ram: how much of a time saving?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
PS incidentally: how can I be 100% sure that I am running the generic kernel?
I tried uname -a but that didn't provide such information
The kernel you are running is specified by the image = /boot/vmlinuz line in /etc/lilo.conf. You can check which of the kernels the soft link vmlinuz points to as follows:
Code:
cd /boot
ls -la | grep vmlinuz
lrwxrwxrwx 1 root root 19 May 16 21:20 vmlinuz -> vmlinuz-generic-3.8.13
-rw-r--r-- 1 root root 3319520 May 12 23:20 vmlinuz-generic-3.8.13
-rw-r--r-- 1 root root 6252192 May 12 23:23 vmlinuz-huge-3.8.13
In this example vmlinuz points to the generic kernel.
If you wanted to run the huge kernel all you would do is remove the existing link and create a new one pointing to huge:
Code:
cd /boot
rm vmlinuz
ln -s vmlinuz-huge-3.8.13 vmlinuz
Now check which kernel the link points to:
Code:
ls -la | grep vmlinuz
lrwxrwxrwx 1 root root 19 May 16 21:20 vmlinuz -> vmlinuz-huge-3.8.13
-rw-r--r-- 1 root root 3319520 May 12 23:20 vmlinuz-generic-3.8.13
-rw-r--r-- 1 root root 6252192 May 12 23:23 vmlinuz-huge-3.8.13
Don't forget to run lilo afterwards if you do this. If you do the opposite, linking vmlinuz to the generic kernel, you will most likely need initrd in /etc/lilo.conf as well, to bootstrap your system with the root filesystem and other information before the kernel loads.
This should tell you whether you're using the generic, huge, or another kernel, assuming the config files in /boot haven't been altered (and I can't think of a valid scenario in which they should be). This will work only for 64-bit Slackware; otherwise you would have to modify the paths to the config files to represent the smp versions.
Code:
if diff <(zcat /proc/config.gz) /boot/config-generic-3.2.29 >/dev/null ; then echo "generic"; elif diff <(zcat /proc/config.gz) /boot/config-huge-3.2.29 >/dev/null; then echo "huge"; else echo "Neither"; fi
The <(...) syntax is a bash-ism so other shells may not allow that.
[edit]
This is perhaps a better command in that it is universal (though it ignores the /boot/config symlink):
Code:
for i in /boot/config-* ; do if diff <(zcat /proc/config.gz) "$i" >/dev/null; then echo "$i"; fi; done
>T3Slider
Once I fixed the first line in lilo.conf to refer to the generic kernel, rebooted, then ran the first of your suggestions, I got this output:
Code:
[root@MudPark:lebec] # if diff <(zcat /proc/config.gz) /boot/config-generic-3.2.29 >/dev/null ; then echo "generic"; elif diff <(zcat /proc/config.gz) /boot/config-huge-3.2.29 >/dev/null; then echo "huge"; else echo "Neither"; fi
diff: /boot/config-generic-3.2.29: No such file or directory
diff: /boot/config-huge-3.2.29: No such file or directory
Neither
So I ran the second and ...bingo! ... it returned:
Code:
[root@MudPark:lebec] # for i in /boot/config-* ; do if diff <(zcat /proc/config.gz) "$i" >/dev/null; then echo "$i"; fi; done
/boot/config-generic-3.9.10
Still doesn't boot any faster, but at least I'm satisfied that I know which kernel I'm running.
Thanks for the code!
And thanks to all respondents.
@AlleyTrotter, do you know how much different streamline_config.pl is to mkinitrd_command_generator.sh?
thanks
One is used to configure the kernel
The other is used to configure an initrd
As to speed I don't know, but streamline_config does greatly reduce the size of the kernel. Since not all modules are built, it reduces the time required to build the kernel
While initrd reduces the number of modules loaded during initial bootup all modules may still be built with the kernel.
Although size may not be an issue, I always think less code less chance of a bug.
john
Last edited by AlleyTrotter; 07-28-2013 at 07:55 AM.
And how much difference would I notice in generalized speed of system:
I do create my own system-optimized kernels, but i wouldn't expect a significant difference because of that alone. What I also do is I patch my kernels with a different CPU scheduler and a different I/O scheduler. This definitely has an impact on the perceived smoothness of the desktop and it has measureable effects as well. Just in case, here are a couple of URLs for further reading.
Thanks for the information.
Filed away against the rainy day when I might try it.
My system is actually purring along and quite adequate to my humble needs.
The original question, although inspired by a genuine desire to get generic kernel booted, was out of curiosity rather than pressing practical need for speed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.