Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
I'm going to be compiling a 2.6.18 kernel for some new Core Duo 2 machines we got in the lab. I'm reasonably sure the kernel will compile with gcc 3.3 but I was wondering if I should use 4.0 or 4.1? I did a quick search for kernel performance benchmarks, but didn't find much. Anyone case to provide links or personal experience?
Also, even with 2.6.18 there is no Core processor type to select. Currently my 2.6.16 stock Debian kernel detects the processor as an Athlon MP which results in much poorer performance than I know is possible. Which processor type should I select, I'm assuming Pentium III or Pentium M, but would greatly appreciate it if somebody could provide an answer instead of me having to compile everything multiple times and benchmark myself. If nobody has done this, I will post my findings here so they might be of some help to others migrating to Core systems.
It tells you in the Changes file which versions of what to use. Most of the software it refers to has to be the version they list or higher. Except for gcc it recommends that you stick closely to the version they recommend.
Like here is what it says in my Changes for 2.6.8.
Quote:
The gcc version requirements may vary depending on the type of CPU in your
computer. The next paragraph applies to users of x86 CPUs, but not
necessarily to users of other CPUs. Users of other CPUs should obtain
information about their gcc version requirements from another source.
The recommended compiler for the kernel is gcc 2.95.x (x >= 3), and it
should be used when you need absolute stability. You may use gcc 3.0.x
instead if you wish, although it may cause problems. Later versions of gcc
have not received much testing for Linux kernel compilation, and there are
almost certainly bugs (mainly, but not exclusively, in the kernel) that
will need to be fixed in order to use these compilers. In any case, using
pgcc instead of plain gcc is just asking for trouble.
The Red Hat gcc 2.96 compiler subtree can also be used to build this tree.
You should ensure you use gcc-2.96-74 or later. gcc-2.96-54 will not build
the kernel correctly.
In addition, please pay attention to compiler optimization. Anything
greater than -O2 may not be wise. Similarly, if you choose to use gcc-2.95.x
or derivatives, be sure not to use -fstrict-aliasing (which, depending on
your version of gcc 2.95.x, may necessitate using -fno-strict-aliasing).
I've compiled 2.4 kernels with gcc version 3.3.5 and never had any problems that I could tell. The system was solid as a rock. However, it's probably better to stick to their recommendation. Afterall, whoever is writing that, is telling us this for a reason. I suspect their reasoning is that the "recommended" gcc version is the one in which they've coded in mind for. There's the possibility for some subtle changes in newer versions of gcc, as well as some unknown bugs that may interact somehow in a manner that may not end up being good. The bottom-line is they're probably telling us all of that because their recommended version is proven and what has been tested against extensively. Other versions of gcc is going into the unknown. May not have problems with some other version, but on the other hand, you might and there isn't really any sort of well tracked and documented testing with them, that I know of. If in doubt, go with the recommendations of the people who have spents many man hours already taking on the headaches for us (kernel devs and/or your distro).
Even though in my case my build went without a hitch, and my system seems rock solid, I still have my reservation about using a non-recommended version of gcc to build with. In the back of my mind I wonder if there is the possibility for there to be some issues that don't make themselve's very known. For instance, features of the kernel being semi-broken in operation that it goes under the radar and allows bad things to creep up. In other words, the very subtle bugs that could be introduced that could have been avoided. This I don't know, but it doesn't seem like it's out of the realm of possibilities to me.
You should check your Changes file to see what they specifically recommend. It may also be a good idea to check and see what your distro recommends if you're compiling a kernel that is their sources. It's actually probably best to follow your distro's recommendation if that is the case. I guess which recommendation to go with is who you put more stock on being more accurate with their facts. However, there may be some "gotchas" that the distro people know about that is specific to their tweaks that may not be an issue to the same version of vanilla kernel.
I just tend to put more stock on distro and the kernel devs recommendations over my own judgement since they've had alot more people testing things than just one person (me).
Thanks for the help. However, this is a bit of an old post. I found a good performance benchmark for the Core Duo 2 systems under Linux on LinuxHardware, http://www.linuxhardware.org/article.../08/22/0415251 Basically you use PentiumM for 32-bit and Nocona (Xeon) for 64-bit. The 64-bit performs rather poorly as a result since the two architectures (Netburst Xeon and Core Duo 2) are quite different. However, since 64-bit distros are having problems (Debian's testing lacks working versions of a lot of programs necessary to get a basic desktop), I decided to just run in 32-bit for now.
As far as compiler, 2.95 is the baseline, all new kernels will compile with anything higher. Around 2.6.16 they attempted to phase out 2.95 requiring 3.1 as a baseline and there was a lot of resistance. However, gcc 4.0 has surpassed 3.3.x in terms of optimized running speed (the only thing I really care about). While the early 3.xs were slower than 2.95, 3.3 and later are faster. Debian and other distros have now moved to using 4.0 for their kernels due to performance improvements. 2.95 gives the advantage that the compiling time is less (useful if you have a slow processor), and it has some better space optimizing options (important if you are on an embedded system), and there is a minor stability argument since it has been out longer.
Basically I would say use 2.95 if stability, size, or compile time is much more important than speed. Use 3.3 is stability is very important, but you want running speed too (i.e. a server) and use 4.0 or 4.1 if speed is important and stability is not as much (i.e. a desktop). In my experience 4.1 gives more than enough stability for a desktop. I think after getting the configurational bugs out of my 2.6.18 kernel I only had one crash and that might be due to a PCI card not being properly retained.
The results of my compile with 4.1 were small performance improvements over the statistics on LinuxHardware for like benchmarks I could run. Generally most of my scores were better, though since many of the benchmarks were influenced if not GPU dependent since I have a better card, this may be skewed. The benchmark that comes closest to what they present is my results of 1 minute 32 seconds on my E6700 for the Mencode benchmark.
Last edited by TemplaraPheonix; 10-02-2006 at 06:21 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.