LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   generic kernel for -currrent with 8GB ram: how much of a time saving? (https://www.linuxquestions.org/questions/slackware-14/generic-kernel-for-currrent-with-8gb-ram-how-much-of-a-time-saving-4175471086/)

01micko 07-27-2013 03:44 PM

Quote:

Originally Posted by textillis (Post 4997906)
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

Good question. I just tried this;
Code:

bash-4.2$ /sbin/lsmod|grep ext
ext4                  411375  1
jbd2                  66646  1 ext4
mbcache                5826  1 ext4

Substitute 'ext' with whatever module you chose when building the initrd needed for your root filesystem. If no output then 'huge' must be running.

There is probably a better test out there.

Gerard Lally 07-27-2013 05:48 PM

Quote:

Originally Posted by textillis (Post 4997906)
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.

T3slider 07-27-2013 06:01 PM

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
[/edit]

textillis 07-28-2013 02:56 AM

>T3Slider: second suggestion seemed to work
 
>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 07-28-2013 07:37 AM

Quote:

Originally Posted by glorsplitz (Post 4998060)
@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

Martinus2u 07-28-2013 08:00 AM

Quote:

Originally Posted by textillis (Post 4997677)
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.

http://ck-hack.blogspot.com/
http://www.algogroup.unimore.it/peop...lo/disk_sched/

textillis 07-28-2013 10:19 AM

>Martinus2u

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.


All times are GMT -5. The time now is 04:52 AM.