Slashdot Mirror


High Performance Linux Kernel Project — LinuxDNA

Thaidog submits word of a high-performance Linux kernel project called "LinuxDNA," writing "I am heading up a project to get a current kernel version to compile with the Intel ICC compiler and we have finally had success in creating a kernel! All the instructions to compile the kernel are there (geared towards Gentoo, but obviously it can work on any Linux) and it is relatively easy for anyone with the skills to compile a kernel to get it working. We see this as a great project for high performance clusters, gaming and scientific computing. The hopes are to maintain a kernel source along side the current kernel ... the mirror has 2.6.22 on it currently, because there are a few changes after .22 that make compiling a little harder for the average Joe (but not impossible). Here is our first story in Linux Journal."

173 comments

  1. GCC compatibility by psergiu · · Score: 1, Interesting

    Why don't they try to make ICC fully GCC compatible so we can recompile EVERYTHING with ICC and have a 8-9 to 40% performance gain.

    --
    1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
    1. Re:GCC compatibility by NekoXP · · Score: 4, Insightful

      Compilers shouldn't need to be compatible with each other; code should be written to standards (C99 or so) and Makefiles and configure scripts should weed out the options automatically.

    2. Re:GCC compatibility by Anonymous Coward · · Score: 0, Insightful

      Too bad that C99 (et al.) isn't enough to write a high performance kernel... Not even close (no interupts, no threads, etc, etc...)

    3. Re:GCC compatibility by dmp123 · · Score: 0

      Also, *compilers* should also be written to standards too, as well as code.

      Don't let them off the hook too easily.

      If all the compilers stuck rigidly to standards, you'd never be able to have code that compiled with one and not the other.

      Davidhttp://linux.slashdot.org/article.pl?sid=09/02/26/2216241#

    4. Re:GCC compatibility by NekoXP · · Score: 2, Informative

      Amazing. You have no idea what you're talking about :D

      C99 doesn't stop you writing interrupt code OR threaded code.

    5. Re:GCC compatibility by NekoXP · · Score: 4, Insightful

      :)

      I think the point is that ICC has been made "gcc compatible" in certain areas by defining a lot of pre-baked defines, and accepting a lot of gcc arguments.

      In the end, though, autoconf/automake and cmake and even a hand-coded Makefile could easily abstract the differences between compilers so that -mno-sse2 is used on gcc and --no-simd-instructions=sse2 on some esoteric (non-existent, I made that up) compiler. I used to have a couple of projects which happily ran on BSD or GNU userland (BSD make, GNU make, jot vs. seq, gcc vs. icc vs. amiga sas/c :) and all built fairly usable code from the same script automatically depending on the target platform.

      The over-reliance of the Linux kernel and it's hardcoded options for GCC means you have to port GCC to your platform first, before you can use a compiler which may already be written by/for your CPU vendor (a good example was always Codewarrior.. but that's defunct now)

      Of course there is always configure script abuse; just like you can't build MPlayer for a system with less features than the one you're on without specifying 30-40 hand-added options to force everything back down.

      A lot of it comes down to laziness - using what you have and not considering that other people may have different tools. And of course the usual Unix philosophy that while you may never need something, it should be installed anyway just because an app CAN use it (I can imagine using a photo application for JPEGs alone, but they will still pull in every image library using the dynamic linker, at load time.. and all these plugins will be spread across by disk)

    6. Re:GCC compatibility by SpazmodeusG · · Score: 3, Informative

      And what is the C99 standard to tell the compiler to pack structures with a 1 byte alignment?

      (Hint: there is no standard way)

    7. Re:GCC compatibility by Punto · · Score: 2, Insightful

      Why don't they improve GCC to have a 8-9 to 40% performance gain? it's not like intel has some kind of secret magical piece of code that lets them have a better compiler.

      --

      --
      Stay tuned for some shock and awe coming right up after this messages!

    8. Re:GCC compatibility by Anonymous Coward · · Score: 0

      They might, on their own hardware.

    9. Re:GCC compatibility by Mad+Merlin · · Score: 1

      The over-reliance of the Linux kernel and it's hardcoded options for GCC means you have to port GCC to your platform first, before you can use a compiler which may already be written by/for your CPU vendor (a good example was always Codewarrior.. but that's defunct now)

      GCC itself is rather prolific... Is there any noteworthy platform that it doesn't already support?

    10. Re:GCC compatibility by forkazoo · · Score: 4, Interesting

      Compilers shouldn't need to be compatible with each other; code should be written to standards (C99 or so) and Makefiles and configure scripts should weed out the options automatically.

      Unfortunately, writing an OS inherently requires making use of functionality not addressed in the C standards. If you stick only to behavior well defined by the ISO C standards you *can* *not* write a full kernel. Doing stuff that low level requires occasional ASM, and certainly some stuff dependent on a particular hardware platform. I think that being as compiler-portable as it is hardware-portable should certainly be a goal. The ability to build on as many platforms as possible certainly helps shake out bugs and bad assumptions. But, just saying "clean it up to full C99 compliancy, and don't do anything that causes undefined behavior" would be ignoring the actual reality of the situation, and makes as much sense as porting the whole kernel to Java or Bash scrips.

    11. Re:GCC compatibility by forkazoo · · Score: 3, Informative

      Why don't they improve GCC to have a 8-9 to 40% performance gain? it's not like intel has some kind of secret magical piece of code that lets them have a better compiler.

      To a large extent, they have. ICC really no longer has the performance lead that it once did over gcc. There was absolutely a time when the difference was consistent, and significant. But, a lot has changed since gcc 2.95, when egcs existed. The 4.x branch in particular has been about improving the optimisation capabilities of the compiler. These days, I generally reccomend just going with gcc to anybody who asks me.

    12. Re:GCC compatibility by Jurily · · Score: 2, Funny

      GCC itself is rather prolific... Is there any noteworthy platform that it doesn't already support?

      Commodore 64?

    13. Re:GCC compatibility by NekoXP · · Score: 4, Informative

      There isn't one, so what you do is use pragmas (I remember #pragma pack(1)) or attributes (__attribute__((packed)) or something similar.

      Of course they're compiler-specific but there's no reason that code can't be written wrapped in defines or typedefs to stop compiler-specific stuff getting into real production code nested 10 directories down in a codebase with 40,000,000 lines.

      Linux does an okay job of this - but since coders usually reference the compiler manual to use these esoteric pragmas and types, they are usually told "this is specific to GCC" (GCC does a good job of this anyway) so they should be wrapping them by default to help their application be portable and maintainable to future compilers (especially if they change the attribute name or the way it works - as has been done on many a GCC, let alone other compilers).

      What usually nukes it (and why linux-dna has a compiler wrapper) is because they're hardcoding options and doing other weird GCC-specific crap. This is not because they are lazy but because the Linux kernel has a "we use GCC so support that, who gives a crap about other compilers?" development policy and it usually takes some convincing - or a fork, as linux-dna is - to get these patches into mainline.

    14. Re:GCC compatibility by NekoXP · · Score: 1

      None but you should think about the hurdles of porting it to a non-POSIX operating system like AmigaOS (yes they did..) and MorphOS (which is like AmigaOS but the GCC port supports a bunch of craaazy extra options) and OMG think of the children!!!!!!!

      Both of those had to rely on a special portability library (newlib port in the first instance, and the ancient "ixemul" library in the second instance) to get it to work, notwithstanding the actual platform features and ABI support.

      Maybe they're not noteworthy but there's plenty of scope for a non-POSIX operating system in the embedded space, where having a custom compiler is a part daily life. What about when you're supporting a new architecture which isn't in mainline GCC for instance, using CodeSourcery patches for a while to enable custom processor features?

    15. Re:GCC compatibility by NekoXP · · Score: 1

      See my other reply on the topic.

      I fully understand the limitations of the C99 standard, but there are also ways to stop your code being tied to a compiler which it seems a lot of coders simply do not bother to use because supporting GCC is their only goal.

    16. Re:GCC compatibility by NekoXP · · Score: 0, Offtopic

      yes, dad.

    17. Re:GCC compatibility by complete+loony · · Score: 1

      Personally, I'm waiting for clang to reach feature / compatibility parity with gcc. It should be able to compile code faster than gcc and in many cases produce better optimised binaries. But there is still a lot of work to be done.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    18. Re:GCC compatibility by Anonymous Coward · · Score: 0

      You do realize that you just admitted to sucking dicks, and by implication, your father's?

    19. Re:GCC compatibility by Nutria · · Score: 1

      A lot of it comes down to laziness - using what you have

      No, it's called using your tools to their fullest capacity.

      --
      "I don't know, therefore Aliens" Wafflebox1
    20. Re:GCC compatibility by BrokenHalo · · Score: 1

      GCC itself is rather prolific... Is there any noteworthy platform that it doesn't already support?

      In any case, the Intel compiler, with its US$599 price-tag is less than likely to be a top contender for inclusion in any distro.

      Sure, there is a "free non-commercial" download available, but you don't have to be Richard Stallman to see the downside of that.

    21. Re:GCC compatibility by michaelmuffin · · Score: 1

      gcc doesn't run on plan 9. plan 9 is just wonderful for clusters. but as most HPC stuff is for gcc only, you either have to port every bit of gcc software you want to use or port gcc itself. both rather daunting tasks

    22. Re:GCC compatibility by NekoXP · · Score: 1

      yeah on a comments thread to some wanker who won't even get a Slashdot account..

      in the grand scheme of things, not very important, wouldn't you say?

    23. Re:GCC compatibility by NekoXP · · Score: 1

      There's no reason you can't build your code to support all the tools you could possibly use to their fullest capacity, though. No reason at all. Except when one tool doesn't do something that the other does that you find important.

      I very much doubt any C compiler shipping these days misses the features required to build the kernel, but the kernel developers only care about adding in GCC options and GCC pragmas and attributes.. in spite of those who would prefer to use some other compiler.

    24. Re:GCC compatibility by SpazmodeusG · · Score: 1

      Sure i could put all the compiler directives around #if-#else blocks but how do i handle possible new compilers with new directives that i don't even know about yet?
      Like the Kernel authors i could do everything you say and still have my code break in a compiler that does things differently.

      The only real solution is for compilers to all start doing things in a fairly standard way. Which leads us back to the great-grandparents suggestion...

    25. Re:GCC compatibility by smittyoneeach · · Score: 1

      Of course not. C99 is the standard. Has there ever been an executable standard? U R teh st00p3d.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    26. Re:GCC compatibility by Crossmire · · Score: 1

      Actually, it's quite likely they do. The beauty of software patents.

    27. Re:GCC compatibility by NekoXP · · Score: 3, Interesting

      I find it hard to believe that the Linux kernel developers never heard of ICC. Or, to take another example, never used Codewarrior or XL C (IBM's PPC compiler, especially good for POWER5 and Cell) or DIAB (or Wind River Compiler or whatever they call it now). Or even Visual C++. Personally I've had the pleasure of using them all.. they all do things differently, but when you have a development team which is using more than one.. I once worked on a team where most of the developers had DIAB, but they didn't want to pay for licenses for EVERYONE, so it was just for the team leaders and release engineering guys, so we all got GCC instead. We had to be mindful not to break the release builds.. and the work ethic meant everything went pretty much fine all round.

      All of them have at one time or still today produce much better code and have much better profiling than GCC and are used a lot in industry. If the commercial compiler doesn't do what you want or is too expensive, GCC is your fallback. Linux turns this on it's head because it "wants" to use as much free, GNU software, but I don't think the development process should be so inhibited as to ignore other compilers - especially considering they are generally always far better optimized for an architecture.

      As a side note, it's well known that gcc 2.95.3 generates much better code on a lot of platforms, but some apps out there are refusing to compile with gcc 2.x (I'm looking at rtorrent here.. mainly because it's C++ and gcc 2.x C++ support sucks. This is another reason why commercial compilers are still popular :) and some only build with other versions of gcc, patches flying around to make sure it builds with the vast majority, significant amounts of development time is already "wasted" on compiler differences even on the SAME compiler, so putting ICC or XCC support in there shouldn't be too much of a chore, especially since they are broadly GCC compatible anyway.

      Like the article said, most of the problem, and the reason they have the wrapper, is to nuke certain gcc-specific and arch-specific arguments to the compiler, and the internal code is mostly making sure Linux has those differences implemented. There is a decent white-paper on it here. The notes about ICC being stricter in syntax checking are enlightening. If you write some really slack code, ICC will balk. GCC will happily chug along generating whatever code it likes. It's probably better all round (and might even improve code quality generated by GCC, note the quote about GCC "occasionally" doing the "right" thing when certain keywords are missing) if Linux developers are mindful of these warnings, but as I've said somewhere in this thread, Linux developers need some serious convincing on moving away from GCC (I've even heard a few say "well, you should fix GCC instead", rather than take a patch to fix their code to work in ICC)

    28. Re:GCC compatibility by Bert64 · · Score: 1

      The performance gap is even bigger on IA64 too...

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    29. Re:GCC compatibility by gzipped_tar · · Score: 1

      (I can imagine using a photo application for JPEGs alone, but they will still pull in every image library using the dynamic linker, at load time.. and all these plugins will be spread across by disk)

      I don't think this is how it's done... In your example, the functions in a imaging library only have their stubs in the PLT (procedure linkage table) loaded into the process. A stub is replaced by the real code once it gets called. If a non-JPEG backend is not used, it will not be loaded into the memory. The argument of disk usage remains valid, though.

      --
      Colorless green Cthulhu waits dreaming furiously.
    30. Re:GCC compatibility by JohnFluxx · · Score: 1

      > I've even heard a few say "well, you should fix GCC instead"

      Well what's wrong with that? If GCC is parsing "bad" code without giving warnings, then GCC should be fixed. The bad code can be fixed to avoid those warnings.

    31. Re:GCC compatibility by Bert64 · · Score: 4, Informative

      Depends on the CPU... gcc has reasonable performance on x86, but on ia64 or ppc the vendor supplied compilers have a big advantage. even on x86 icc leads by a considerable margin in some areas, especially on very new processors.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    32. Re:GCC compatibility by scotch · · Score: 2, Funny

      All my feature-incomplete software is really fast, too.

      --
      XML causes global warming.
    33. Re:GCC compatibility by coolsnowmen · · Score: 1

      There definitely are standards for executables; otherwise, how would a processor know what the program wanted it to do?
      As in, the folks at gcc, don't reverse engineer a pentium chip to figure out how how to get it two add two numbers together. They look up the binary standard for "x86" or the like.

    34. Re:GCC compatibility by 42forty-two42 · · Score: 4, Informative

      On the contrary - there is no support for threads or interrupts whatsoever in C99. Sure, there's pthreads and the like - but those are not part of C99, nor can you implement them in pure C99.

      C itself (all versions) tries very hard to avoid tying itself to any specific hardware or OS. It even supports weird things like platforms with more than 8 bits in a char, or with reserved bits in their integers. But as a result, it has only the bare minimum featureset common across all platforms imaginable, and this is why it's very hard to write anything useful with only pure C. (No networking, no listing the contents of a directory, no executing any other programs except via system()...)

      For most userland applications, C plus some OS-dependent libraries are good enough, of course. Things like the POSIX API can't be implemented in regular C (at some level you have an assembly call to the OS's syscall interface), but if you treat it as opaque, no problem.

      But for an OS kernel, things aren't that easy. In the quest for high performance, Linux does all kinds of neat hacks, including things like inlining assembly code into C functions - and later rewriting that code on the fly (google for 'smp alternatives' for more information). It also makes use of CPU-level atomic operations - and exactly which ones are available depend on the architecture. Because of these kinds of hacks, which produce noticeable speed improvements, it is utterly impossible to stick purely to standards like C99.

    35. Re:GCC compatibility by Anonymous Coward · · Score: 0

      The amazing thing is that *you* have no idea what you're talking about and act as some kind of authority.

      C99 doesn't have any concept of atomicity and therefore everything involving threads is undefined behaviour and purely a QOI issue. So stop talking out of your ass...

    36. Re:GCC compatibility by Anonymous Coward · · Score: 0

      Sheeeesh... U R teh autistic lamer!
      Everybody with half a brain understood what was meant: C99 doesn't give enough guarantees to write multithreaded applications, let alone operating systems. So you have to rely on non C99 language features.

      It's really incredible what kind of know-nothing posers are hanging around here.

    37. Re:GCC compatibility by cheater512 · · Score: 1

      AVR chips are brilliant for low level embedded stuff.
      Full GCC support of course.

    38. Re:GCC compatibility by Rockoon · · Score: 1

      ICC is hands down the best C++ compiler for x86 and x64 from a performance perspective. GCC isnt even in the running on that front. All GCC has going for it is that its "free" ..

      If I was heading the GCC development effort, I would be stearing towards being 100% ICC 10.x compatible because of the massive benefits of doing so, because that would fucking rock and everyone fucking knows it.

      While its cool and all that you have found an excuse not to use ICC, the fact remains that its fucking fantastic in comparison.

      --
      "His name was James Damore."
    39. Re:GCC compatibility by Anonymous Coward · · Score: 0

      Then you're clueless about compilers. For instance, the Sun Studio compilers generate up to 80% faster code than GCC 4.x.

    40. Re:GCC compatibility by pipatron · · Score: 1

      The issue isn't really that GCC isn't portable, but it's quite bloated, so there's a lot of room for alternative compilers. You simply don't want a full GCC install on a 32MB flash device for example, even if you might want a compiler installed.

      --
      c++; /* this makes c bigger but returns the old value */
    41. Re:GCC compatibility by guruevi · · Score: 1

      Why they don't do it:

      1) Historic reasons. The project started small with GCC and the code has been building from there. Through historic code it became increasingly more difficult to use non-GCC compilers.

      2) Compatibility: As no. 1, the project start with GCC and requires a bit of rewriting in the core functions that the people with non-gcc compilers won't always understand. It might also be difficult to find alternatives stuff that isn't in the C/C++ standard but can be done compiler specific. It would become increasingly difficult and expensive not only to write code for each specific compiler but also to maintain it.

      3) Cost: You have to remember, these are volunteers doing this stuff in their spare time. Some might have access to other non-free compilers but prohibited to make a copy for personal use or non-company use. Some of these compilers can cost 1000's of dollars and then you might still not be able to use them because of 4, or the increase in performance only minimal or worse, decreased. It's only valuable for people that absolutely need to squeeze every percent of performance out of a cluster. For most other cases, throwing that money for the compiler in new hardware might be cheaper.

      4) Licensing: You never know if non-free software has certain usage limitations or patents related to it. If you decide to eg. use Visual C++ and Microsoft has somewhere in the EULA that if any code written is specifically for Visual C++ (exception cases) they become the owners of the project, then you have tainted the Linux kernel. It's difficult and expensive to get a lawyer to go through each piece of documentation on a) the kernel and b) the compiler to see if stuff is becoming tainted.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    42. Re:GCC compatibility by LizardKing · · Score: 1

      GCC is not very well structured, making it hard to work on (it has a relatively poor intermediate language as well). As a result it can be very painful trying to improve GCC, so it could be good for the Linux kernel to try and isolate GCC'isms as much as possible in order to make it easier to support building from other compilers.

    43. Re:GCC compatibility by LizardKing · · Score: 1

      Cost: You have to remember, these are volunteers doing this stuff in their spare time.

      No, these days most of the code that makes it into the Linux kernel tree is from developers employed by people like RedHat, SuSE, IBM and so on. Check the Git statistics or follow the (albeit voluminous) kernel development mailing list.

    44. Re:GCC compatibility by XDirtypunkX · · Score: 1

      Yes, but you can isolate this into a particular part of the code and put an abstraction layer around it. Compiler, hardware and OS portability are very much the same in that respect.

      Sometimes you can't escape platform inconsistencies when porting. You have to live with creating your own levels of abstraction.

  2. Portability.. by thesupraman · · Score: 5, Insightful

    IMHO This is a great development, for one important reason.

    Portability of the kernel.

    GCC is a great compiler, but relying on it excessively is a bad thing for the quality of kernel code, the wider range of compilers used, the more portable and robust the code should become.

    I know there will be the usual torrent of its-just-not-open-enough rants, but my reasoning has nothing to do with that, it is simply healthy for the kernel to be compilable across more compilers.

    It also could have interesting implications with respect to the current GCC licensing 'changes' enforcing GPL on the new plugin structures, etc.

    GCC is a wonderful compiler however it has in the past had problems with political motivations rather than technical, and moves like this could help protect against those in the future (some of us still remember the gcc->pgcc->egcs->gcc debarcle).

    Of course no discussion of compilers should happen without also mentioning LLVM, another valuable project.

    1. Re:Portability.. by mrsbrisby · · Score: 4, Insightful

      GCC is a great compiler, but relying on it excessively is a bad thing for the quality of kernel code ... it is simply healthy for the kernel to be compilable across more compilers.

      Prove it.

      The opposite (relying on GCC is a good thing for code quality) seems obvious to me. The intersection of GCC and ICC is smaller than GCC, so I would assume that targetting something big would afford greater flexibility in expression. As a result, the code would be cleaner, and easier to read.

      Targetting only the intersection of ICC and GCC may result in compromises that confuse or complicate certain algorithms.

      Some examples from the linked application include:

      • removing static from definitions
      • disabling a lot of branch prediction optimizations
      • statically linking closed-source code
      • tainting the kernel making debugging harder

      I cannot fathom why anyone would think these things are "good" or "healthy", and hope you can defend this non-obvious and unsubstantiated claim.

      (some of us still remember the gcc->pgcc->egcs->gcc debarcle).

      When pgcc showed up, it caused lots of stability problems, and there were major distribution releases that made operating a stable Linux system very difficult: 2.96 sucked badly.

      The fact that gcc2 still outperforms gcc4 in a wide variety of scenarios is evidence this wasn't good for technical reasons, and llvm may prove RMS's "political" hesitations right after all.

      I'm not saying gcc4 isn't better overall, and I'm not saying we're not better for being here. I'm saying it's not as clear as you suggest.

    2. Re:Portability.. by Anonymous Coward · · Score: 0

      ...and llvm may prove RMS's "political" hesitations right after all.

      What does this mean?

    3. Re:Portability.. by LeafOnTheWind · · Score: 1

      Try compiling your C Real Mode code in GCC and get back to me.

    4. Re:Portability.. by thesupraman · · Score: 2, Insightful

      Oh, wait a second, I see the problem here.

      You are a moron.

      What exactly do you think happens when GCC changes behavior (as it has done in the past, many times) within the C spec?

      Perhaps we better freeze on version x.y.z of GCC?

      The same would apply to for example assumptions with branch prediction - gcc can and quite probably one day will change behavior - do you really want major features of the kernel to change behavior when this happens?
      The good effect this will have when addressed properly (and remember what you are referencing above is a small group making a starting attempt to achieve this outcome..) is that anything worthwhile AND compiler specific will become clearly marked and optional to the compiling process - therefore increasing the total quality of the kernel. Such assumptions should NEVER be simple spread through the code unmarked.

      By supporting a range of compilers we help make the kernel MORE robust to such changes, and these are both highly competent compilers, so the 'intersection' of features is actually most of the C/C++ specs..

      Of course you obviously have zero experience of such things. You seem to think 'better' means more highly tuned code - try maintaining a major project for more than 6 months, and you may well learn a thing or two.

      pgcc, and more importantly egcs, were the only things that broke the complete stagnation and navel-gazing of gcc that was threatening to cause its death. with the hard work and risk taken by the developers of both, gcc would not be nearly as strong as it is now.

      Again, you dont seem to know what you are talking about, do you perhaps measure compiler 'goodness' by Dhrystone mips?

    5. Re:Portability.. by walshy007 · · Score: 2, Informative

      Oh, wait a second, I see the problem here.
      You are a moron.

      First up, personal attacks to the parent does not an argument prove, all it does is lessen your credibility.

      By supporting a range of compilers we help make the kernel MORE robust to such changes, and these are both highly competent compilers, so the 'intersection' of features is actually most of the C/C++ specs..

      Of course the intersection of features are the specs.. because they are the only standardized thing that makes it c, but as has been said, C leaves a LOT to the implementer in order to be flexible, the standard does not specify everything, and operating systems need to run at such a low level that what they deal with is NOT covered in said specs,

      Furthermore, as for being 'more robust' to breakage when compiler changes occur by supporting more changes, bollocks, now instead of supporting one standard compiler that worked for platforms x,y and z with portable coding practices, you now have to monitor a second compilers changes just so it doesn't break on platform x aswell

      Also you have to monitor that any changes you do to support the second compiler, don't break the building of the three platforms on the first.

      Sounds like a lot of work for essentially no gains, and a lot of added complexity and room for errors that simply doesn't need to be there.

      Of course you obviously have zero experience of such things. You seem to think 'better' means more highly tuned code - try maintaining a major project for more than 6 months, and you may well learn a thing or two.

      By trying to support multiple compilers by changing source code to suit, you really are killing maintainability, with normal programs it might not be so bad, but as said the kernel relies on a LOT of things not standardized between compilers(inline assembly, etc etc), writing compiler specific portions for every aspect of it (and maintaining it) would be hell.

      Again, you dont seem to know what you are talking about, do you perhaps measure compiler 'goodness' by Dhrystone mips?

      I agree performance is never the be all and end all, however going the other route and saying performance is nothing is just as absurd.

    6. Re:Portability.. by Anonymous Coward · · Score: 0

      I have ported a few systems between compilers. EVERY SINGLE TIME I move to a different compiler I find new bugs. Bugs that existed and 'didnt really do much damage'. But still crazy bugs that would crash things once and awhile. Usually I find 1 to 2 deadly bugs. As in yes this would crash the system dead bugs. Yet 'just worked' on the old compiler.

      It does not hurt to have another group go over the code and revisit your assumptions. Even if you are involved in the group. Using code in a new way sometimes makes bad assumptions pop to the top.

      But you are advocating if I am reading you correctly 'to hell with other compilers use gcc4 it is the rocking best one out there'. That is your choice. But remember this is open source. Just because *YOU* do not approve of what they are doing to the code means they should stop. I think it was a cool idea. Much like the guy who ported it to windows.

    7. Re:Portability.. by Anonymous Coward · · Score: 0

      Yes, we must all rely on the One True Compiler. Amen. Don't need no outside stuff. What Church of GNU provides us is teh Best.

    8. Re:Portability.. by mrsbrisby · · Score: 1

      But you are advocating if I am reading you correctly 'to hell with other compilers use gcc4 it is the rocking best one out there'.

      Then work on your reading comprehension. I said no such thing.

      I said it isn't obvious that supporting other compilers was a good thing, and that it seemed obvious that actively supporting other compilers (i.e. "more work") had some serious costs that were being underepresented.

      Re-read my post. Nowhere did I suggest anyone stop doing what they were doing.

    9. Re:Portability.. by mrsbrisby · · Score: 1

      How is this relevant?

  3. Re:Thank to this fast linux kernel I got first pos by McGiraf · · Score: 1

    hum... not that impressive ...

  4. 40% faster kernel, but what overall performance? by whoever57 · · Score: 3, Interesting
    Since all the userland code is still compiled with GCC, what overall performance improvement will this bring?

    Ingo A. Kubblin is quoted as saying:

    "... boost up to 40% for certain kernel parts and an average boost of 8-9% possible"

    is that 8-9% overall speedup of applications, or just kernel tasks?

    --
    The real "Libtards" are the Libertarians!
  5. Re:40% faster kernel, but what overall performance by jd · · Score: 1

    I would imagine that it means for the kernel. We would then need to factor in how much time user applications spend in the kernel. Anything that is I/O-intensive is kernel-intensive. Anything that is malloc-intensive may be kernel-intensive if you're using a VM-based memory pool rather than a pre-allocated one.

    I'm also wondering how this would compare to using Cilk++ and #defining the few keywords it has to the standard keywords when using vanilla GCC or ICC.

    Perhaps there should be a table showing the relative performance of the different kernel subsystems under different compilation methods.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  6. My post is 5-9% faster to read overall... by mattaw · · Score: 2, Interesting
    ...and 40% faster in parts. FACTS - give me some context to judge if this is good or bad.

    Looking at Amdahl's law (golden oldie here) how much time does a PC spend on kernel tasks these days?

  7. It's a Bad Idea. by Anonymous Coward · · Score: 4, Funny
    Personally, I am looking forward to the Low Performance Linux Kernel project.

    You see, I'm a consultant and am paid by the hour.

    1. Re:It's a Bad Idea. by PrescriptionWarning · · Score: 3, Funny

      You could just use Vista in that case... why wait for something slower! Oh wait, you like waiting. Ok, wait away.

    2. Re:It's a Bad Idea. by Anonymous Coward · · Score: 0

      Rewrite the Linux kernel in java.

      The machine would take 3 days to boot, and garbage collection would make pretty much anything unusable while it's running.

    3. Re:It's a Bad Idea. by Yetihehe · · Score: 1

      Yo dawg, I heard you like waiting, so we put a timer in your timer so you can wait while you wait

      --
      Extreme Programming - Redundant Array of Inexpensive Developers
  8. Average Joe, the ubergeek by Anonymous Coward · · Score: 0

    FTA: the mirror has 2.6.22 on it currently, because there are a few changes after .22 that make compiling a little harder for the average Joe (but not impossible). Here is our first story in Linux Journal."
    ..because the average Joe compiles his Linux 2.6.22 kernel with the intel C compiler. On gentoo linux! His neighbour, Sixpack Fred on the other hand, can compile his lastest kernel with the intel compiler. On a C64. From 7 feet away. While humming all the instruments in Ride of the Valkyries.

  9. compilers? by __aardcx5948 · · Score: 2, Insightful

    So GCC is slow compared to the Intel compiler?

    1. Re:compilers? by TheThiefMaster · · Score: 1

      Does GCC run faster if compiled with ICC?

      That would take the biscuit.

    2. Re:compilers? by gzipped_tar · · Score: 3, Interesting

      I can't judge because my experience with ICC is minimal. GCC is constantly improving, but I feel it concentrates more on platform support than performance. The GCC team has to work on ARM/MIPS/SPARC/whatever while ICC only need to work on x86.

      So I'm not surprised to see GCC falling behind Intel in x86 performance. In fact, only recently did GCC began to support local variable alignment on the stack, which I think is a basic optimization technique. (See the 4.4 pre-release notes http://gcc.gnu.org/gcc-4.4/changes.html, search for the phrase "align the stack" in that page)

      --
      Colorless green Cthulhu waits dreaming furiously.
    3. Re:compilers? by dfn_deux · · Score: 2, Informative

      The GCC team has to work on ARM/MIPS/SPARC/whatever while ICC only need to work on x86.

      ICC supports IA-32, Itanium 1 & 2, x86-64, and xscale. Not that it kicks too much of a leg from your argument, but if you are going to argue the point you should at least make it accurate. Ah yeah almost forgot to mention all the extended instruction sets too... SSE, SSE2, SSE3, MMX, MMX2, etc...

      --
      -*The above statement is printed entirely on recycled electrons*-
    4. Re:compilers? by gzipped_tar · · Score: 1

      hmm, you are right, I was using the term "x86" rather loosely..

      --
      Colorless green Cthulhu waits dreaming furiously.
    5. Re:compilers? by Cheapy · · Score: 1

      ICC is better at optimization than GCC.

      --
      Would you kindly mod me +1 insightful?
    6. Re:compilers? by SSCGWLB · · Score: 1

      I have used both GCC (v3.x, v4.x) and Intel compiler (v10.x and v11) on Intel and AMD cpus. Exact same code, only change was the compiler. I don't remember a single case where icc compiled binaries were slower, in general they were significantly faster.

      Overall, we saw a 1% to 30% decrease in execution time. The performance improvement was application specific and most significant when doing a lot of math. As expected, applications that where not CPU bound received little if any performance improvements. Changing the compiler does not speed up your network, disk, or fix poor design decisions :)

      Given the price of intel compilers, I think GCC is all the majority of the linux world needs.

  10. Yes! by Arakageeta · · Score: 3, Insightful

    I completely agree. I ran into this when I was working as a software architect on a project that had been around for a while. Contracts were required compiler compatibility instead of standard compatibility. It made updates to the dev environment much more complicated. The contracts should have specified standards, but its writers didn't know any better-- the customer had no need to stick to a compiler product/version. It also makes your code more dependent upon the compiler's quirks. I would mod you up if I had the points.

  11. Will this kernel run fast on AMD processors? by steveha · · Score: 5, Interesting

    A few years ago someone figured out that Intel's compiler was engaged in dirty tricks: it inserted code to cause poor performance on hardware that did not have an Intel CPUID.

    http://techreport.com/discussions.x/8547

    But perhaps they have cleaned this up before the 10.0 release:

    http://blogs.zdnet.com/Ou/?p=518

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Will this kernel run fast on AMD processors? by Jah-Wren+Ryel · · Score: 4, Interesting

      A few years ago someone figured out that Intel's compiler was engaged in dirty tricks: it inserted code to cause poor performance on hardware that did not have an Intel CPUID.

      It wasn't necessarily malicious, all the compiler did was default to a "slow but safe" mode on CPUIDs that it did not recognize. Intel's reasoning was that they only tweaked the code for cpus that they had qual'd the compiler against. Seeing as how they were Intel, they were not particularly interested in qualing their compiler against non-Intel chips. In hindsight, what they should have done is add a "I know what I'm doing dammit!" compilation flag that would enable optimizations anyway.

      --
      When information is power, privacy is freedom.
    2. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 2, Informative

      Nope, they have not changed that, and I think it is quite bad behavior for Intel.

      However the do _not_ insert _bad_ code. What they do is that they prevent code optimized for the newest Intel CPUs to run on non-Intel CPUs, even if all the used instructions is present. I think -xW (use SSE, SSE2, optimize for Pentium4) is the highest that will run on AMD.

      However in almost all cases the Intel compilers will still produce the fastest binaries on AMD. Not only compared to GCC, but also compared to other commercial compilers like PGI (with have specific optimization flags for the latest AMD CPUs.)

    3. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 2, Insightful

      It was completely intentional. Intel's CPUID protocol defines how to determine the capabilities of a CPU. AMD follows this protocol. Intel could have checked the CPUID for the level of SSEx support, etc. Instead they checked for the "GenuineIntel" string before enabling support for extra instructions that speed up many diverse activities (e.g. copying memory).

      Perhaps your gullibility meter needs recalibration.

    4. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 5, Interesting

      It wasn't necessarily malicious

      Like Hell it wasn't. Read this and see if you still believe it wasn't malicious.

      http://yro.slashdot.org/comments.pl?sid=155593&cid=13042922

      Intel put in code to make all non-Intel parts run a byte-by-byte memcpy().

      Intel failed to use Intel's own documented way to detect SSE, but rather enabled SSE only for Intel parts.

      Intel's C compiler is the best you can get (at least if you can trust it). It produces faster code than other compilers. So, clearly the people working on it know what they are doing. How do you explain these skilled experts writing a byte-by-byte memcpy() that was "around 4X slower than even a typical naive assembly memcpy"?

      People hacked the binaries such that the Intel-only code paths would always be taken, and found that the code ran perfectly on AMD parts. How do you then believe Intel's claims that they were only working around problems?

      I'm pissed at Intel about this. You should be too.

    5. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      However the do _not_ insert _bad_ code.

      Read this, and pay close attention to the discussion of the byte-at-a-time memcpy.

      http://yro.slashdot.org/comments.pl?sid=155593&cid=13042922

      What they do is this (in C-like pseudocode):

      if (cpuid() == "GenuineIntel")
              run_efficient_code();
      else
              run_horrible_inefficient_code();

      You could replace all of the above with

      run_efficient_code();

      So I think it is fair to say that they insert bad code.

      Also, they use the GenuineIntel test to decide whether to enable SSE or not, instead of asking the chip if it supports SSE, as you noted.

    6. Re:Will this kernel run fast on AMD processors? by thesupraman · · Score: 1

      Its their compiler, they are damn well allowed to do what they want - call me when AMD pour that kind of resource into having their own compiler.

      Of course, developers are also free to therefore ignore the compiler, and hence this situation righted itself pretty quickly and naturally.

      I wonder, do you consider RMSs current moves on GCC to also be 'malicious' since it in effect could result in lower performance for end users than is possible, and defined along political lines?

    7. Re:Will this kernel run fast on AMD processors? by palegray.net · · Score: 2, Insightful

      Its their compiler, they are damn well allowed to do what they want - call me when AMD pour that kind of resource into having their own compiler.

      Sure, they can do what they want. But it's generally a bad idea to lie about what you've done once you're caught red-handed. You go from losing a lot of respect to nearly all respect in the minds of many customers.

    8. Re:Will this kernel run fast on AMD processors? by JohnFluxx · · Score: 3, Informative

      > Its their compiler, they are damn well allowed to do what they want - call me when AMD pour that kind of resource into having their own compiler.

      ARM put money into GCC. That's far better than them trying to make their own compiler.

    9. Re:Will this kernel run fast on AMD processors? by Tokerat · · Score: 3, Insightful

      Ok I'll bite. By your logic, Intel should:

      • Spend the time and money to test competitors current CPUs against their compiler.
      • Take the blame when their compiler causes unforseen problems on current or newer models due to changes, or aspects they did not know to test for.

      While I agree that something like --optimize_anyway_i_am_not_stupid would have been a good idea, does it make more sense for Intel to spend money and time making their competition faster? You'd need to make a lot of assumptions to think that optimizations for one CPU will work well for another, even from the same manufacturer. Besides, doesn't AMD have their own compiler?

      --
      CAn'T CompreHend SARcaSm?
    10. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      Its their compiler, they are damn well allowed to do what they want

      And I am damn well allowed to be pissed at them for it.

      And you are okay with this sort of sneaky bullshit? Generating code that sandbags the competition, and lying about it?

      Would you have been pissed if it had been Microsoft generating bad code for certain processors?

    11. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      does it make more sense for Intel to spend money and time making their competition faster?

      It does not make sense for Intel to try to make AMD chips outperform Intel chips. So, I'm okay with Intel not supporting AMD-specific features.

      I'm also okay with Intel just generating code that works on their processors, and if it fails to work on an AMD processor, saying "too bad; we don't care."

      I am not at all okay with Intel detecting non-Intel chips, and deliberately generating terrible code. Which is what they did. Read the damn link about a memcpy that is 4X slower than a naively hand-coded one.

      You'd need to make a lot of assumptions to think that optimizations for one CPU will work well for another

      For crying out loud, did you READ the provided links? People have figured out how to hack the binaries made by the Intel compiler, and force the test for "GenuineIntel" to always succeed. So, the code runs the special optimized code for all CPUs, not just for Intel chips. AMD chips ran the special, optimized code just fine.

      So, basically, you don't know what you are talking about here. You are arguing the abstract in the face of evidence that disproves your abstract idea.

      Besides, doesn't AMD have their own compiler?

      What does that have to do with anything? Unless you have evidence that AMD is doing the exact same thing... in which case I'll be pissed at AMD too, two wrongs don't make a right. But of course AMD hasn't done the exact same thing.

    12. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      I'm pretty sure you still don't understand where Intel were coming from. If they made a song-and-dance about how excellent their compiler is at compiling, and some weird AMD quirk caused generated code to malfunction, then the reputation of the compiler would be damaged.

      But, by playing it safe, i.e. only optimising for the cases that they know about (i.e. their own platform, where they _know_ which optimisations will work, as opposed to _assuming_ a given optimisation is optimal) then even though it produces less-efficient code, the code is guaranteed to work on the target platform.

      It goes back to the premise that a compiler *must* compile code correctly, and people rely on this all the time. The majority of time, people will assume a problem with their application is due to a coding error, not the compiler generating bad code - it takes a lot of analysis to propagate a bug into that category.

      So, if the Intel compiler generates code that is always guaranteed to work, then it's fulfilling it's duty as a compiler. It just so happens that the Intel compiler knows about it's own target platform, and can therefore produce smaller and faster code exploiting the knowledge it has about the target platform.

      It's not a case of "insert-malicious-code-for-non-intel-targets", it's a case of "insert-safe-code-for-targets-we-don't-know-about".

    13. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      ...

      Would you have been pissed if it had been Microsoft generating bad code for certain processors?

      You must be new here. That's the ONLY kind of code Microsoft generates, and that create all kinds of anger issues with Slashdot denizens.

    14. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      AMD did spend money on improving GCC (hint: it was one of my jobs when I was working at AMD). They purposefully chose not to go the proprietary compiler route because they're a hardware business not software.

      Well that and they saw the virtues of contributing to a wider arena. Not all of the improvements submitted by AMD were solely for x86 platforms. Some where generic GCC fixes (same to the kernel).

      Not saying that Intel isn't doing nice things too, but ICC is a step backwards if their goal is making the most out of their hardware (question: how many people are NOT using ICC because of cost?)

    15. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      ARM does have its own compiler. And it generally far out performs GCC, especially for chips with the new v7 ISA.

    16. Re:Will this kernel run fast on AMD processors? by tlhIngan · · Score: 1

      Its their compiler, they are damn well allowed to do what they want - call me when AMD pour that kind of resource into having their own compiler.

      ARM put money into GCC. That's far better than them trying to make their own compiler.

      ARM may have put money into GCC, but... ARM also sells their own compiler - RealView Development Suite (RVDS).

      As for why ARM would do both - the RVDS is a high-performance ARM compiler and ARM's code, so they'll put a lot of optimizations into it. (Ignore the ARM/GNU compatibility - it's because ARM wisely thought up of an ABI and calling convention that most people subscribe to - unlike the x86 where you can have cdecl, stdcall, fastcall, pascal, among others - there's only one real one in ARM).

      But ARM also realizes that there's a competitive advantage to having GCC as well - having an easily available set of development tools can only encourage others to adopt your platform. (Which is probably how ARM catapulted from "just another CPU architecture" into more or less the top-selling processor architecture around, outselling even x86 - heck, an x86 PC probably already has a few ARM cores in it).

      That said, GCC 2.9.x on ARM basically sucked as a compiler - when a speed up can be obtained by changing a test for zero (i.e., "if (variable == 0)") into the more usual form ("if (!variable)"), something's wrong. I believe GCC 3.x and 4.x are now very much improved these days because of it. (In the end, I actually managed to rewrite the code to get rid of that...).

    17. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      It's not a case of "insert-malicious-code-for-non-intel-targets", it's a case of "insert-safe-code-for-targets-we-don't-know-about".

      Where "safe" means "incredibly slow code" and "don't ever use SSE". That level of safety is indistinguishable from malice.

      http://slashdot.org/comments.pl?sid=1142533&cid=27006783

    18. Re:Will this kernel run fast on AMD processors? by Anonymous Coward · · Score: 0

      Uhm, they do you know.

      Ever heard about RVCT? It produces faster and smaller code than GCC (but GCC 4 is catching up)

      http://www.arm.com/products/DevTools/RVCT.html

  12. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 5, Funny

    They should think about moving to a Java kernel. They could just bootstrap one of the new, clever "Just-In-Time" Virtual Machines at powerup.
    These JVMs are able to dynamically optimize the running code in real-time, far beyond what could be achieved by C or C++ compilers, without any performance degradation.
    A Java kernel would likely run at least 50 times faster then the very best hand coded assembler - and since the language is completely type-safe and doesn't implement dangerous legacy language features such as pointers or multiple-inheritance then it would be unlikely to ever crash.

  13. SSE, SSE2, SS3, SSE4, etc. by Enderandrew · · Score: 1

    I've always wondered if anyone has spent time trying to develop optimizations for the kernel if various specific instruction sets are detected?

    --
    http://blindscribblings.com - Tasty pop-culture in conceptual fashion.
    1. Re:SSE, SSE2, SS3, SSE4, etc. by joib · · Score: 1

      The kernel uses lazy context switching for floating point registers. A side-effect of this is that the kernel itself cannot use those registers.

    2. Re:SSE, SSE2, SS3, SSE4, etc. by Anonymous Coward · · Score: 0

      What things do you think a kernel does that benefit from SSE like instructions?

      Seems about the best is from time to time a particular chipset might be able to zero fresh memory pages faster with SSE like help, but in general kernels don't do very much that benefit.

  14. letme google that for ya. by emj · · Score: 1
    1. Re:letme google that for ya. by Anonymous Coward · · Score: 0

      Errr, why not? If it gives more performance, why not? Are there any negative sides?

    2. Re:letme google that for ya. by Enderandrew · · Score: 1

      Both Intel and AMD have contributed code before. You figure if anyone knows how to optimize code for specific processor instruction sets it would be them. It would be a neat way for them to contribute.

      --
      http://blindscribblings.com - Tasty pop-culture in conceptual fashion.
    3. Re:letme google that for ya. by setagllib · · Score: 2, Informative

      It severely cripples maintenance. Any optimisation, especially one that forks you into multiple parallel implementations (raw C, x86 asm, amd64 asm, amd64 ASM with SSE4, PPC, ....), has to be carefully weighed against its extra maintenance cost.

      The parts that do benefit from optimisation, such as RAID parity calculation, symmetric encryption, etc. are already optimised. At any rate I think the kernel developers know a lot more about this than you or I do.

      --
      Sam ty sig.
  15. We're going about the problem the wrong way by doofusclam · · Score: 1

    Wouldn't it be better to fix GCC so it has the same optimisations?

    1. Re:We're going about the problem the wrong way by setagllib · · Score: 2, Informative

      That's being done too. GCC 4.3 with Profile Guided Optimisation is SWEET. I don't think plain PGO can be run on a kernel (but that would be an awesome project), but it would definitely close the gap between ICC and GCC. ICC's PGO is not as good, or rather, ICC itself is better at making the kind of fuzzy predictions that PGO makes definite.

      --
      Sam ty sig.
  16. Re:Who cares? by Anonymous Coward · · Score: 0

    Looking around, without leaving my chair, I see a commercial firewall/VPN/router box running Linux. I see a commercial wireless accesspoint running Linux. I see a commercial PBX running Linux. And I see two different embedded boards running Linux (admittedly our private design).

    Yup...I guess you're right. No one uses Linux for anything important.

  17. Re:Who cares? by Troy+Baer · · Score: 1

    No one uses Linux for anything important.

    Other than every supercomputer on the planet worth talking about, that is...

    --
    "My life's work has been to prompt others... and be forgotten." --Cyrano de Bergerac
  18. Re:40% faster kernel, but what overall performance by setagllib · · Score: 3, Interesting

    If your program is malloc-intensive and you care about performance, you may as well just use a memory pool in userland. It is very bad practice to depend upon specific platform optimisations when deciding which optimisations not to perform on your code. Then you move to another operating system like FreeBSD or Solaris and find your assumptions were wrong and you must now implement that optimisation anyway.

    --
    Sam ty sig.
  19. Re:Wasn't it just a couple of years ago... by ClosedSource · · Score: 1

    Get back to us when the US missile defense system has actually destroyed a foreign missile (assuming that Slashdot is still around then).

  20. Re:Wasn't it just a couple of years ago... by thewils · · Score: 1

    It's not designed to do that. It's designed to suck up as much money as possible whilst simply threatening to down a missile.

    --
    Once I was a four stone apology. Now I am two separate gorillas.
  21. LLVM has enabled propritary forks of GCC by Anonymous Coward · · Score: 0

    LLVM has enabled proprietary forks of GCC, effectively.

    For example Adobe has recently released a C -> FlashVM compiler. It leverages GCC's great front end. Some of the people most excited by alchemy were the folks working on open flash engines (and projects like haXe), unfortunately, alchemy uses LLVM to couple GCC's front end with proprietary a code generation backend.

    So it looks like we're headed back to the bad old days where everything had its own proprietary and incompatible compiler. :(

  22. Unimpressed with ICC by Erich · · Score: 4, Interesting
    We tried ICC on our simulator. The result: 8% slower than GCC. On intel chips. Specifying the correct archtiecture to ICC.

    We were not impressed.

    --

    -- Erich

    Slashdot reader since 1997

    1. Re:Unimpressed with ICC by thesupraman · · Score: 1

      I call BS, there are cases where GCC can beat ICC, however there are many more where ICC is significantly better.

      My bet, either you are full of BS, or you 'tried' a rather specific and limited codebase.

      I also suspect your codebase was developed under gcc and then just thrown at icc? hmmmm?

      ICC is a VERY impressive compiler, GCC is a quite good compiler. we are lucky to have both (and then a few other options as well).

    2. Re:Unimpressed with ICC by cerberusss · · Score: 1

      Instead of agressively attacking and answering in generalities ('there are many cases where ICC is beter'), care to explain how you formed your opinion?

      --
      8 of 13 people found this answer helpful. Did you?
    3. Re:Unimpressed with ICC by JayJay.br · · Score: 1

      Hey, but I bet you haven't tried with the article-mentioned "Intel ICC Compiler". Now with more redundancy! That will get you 200% more runtime than GCC!!

      Maybe "Intel ICC Compiler for C Language"? Oh, that's a winner.

    4. Re:Unimpressed with ICC by justthinkit · · Score: 1

      I suspect you don't realize who you are messing with. 151 is a palindromic prime (but then again so is one of the factors of 179040). Never mind.

      --
      2*7*68213

      --
      I come here for the love
    5. Re:Unimpressed with ICC by Erich · · Score: 1

      Like I said, we were only interested in one application: our simulator. It was developed for gcc and suncc for sparc. icc produced a slower binary. ICC may be faster over a wide variety of benchmarks, and probably especially ones where vectorization, etc can be used. However, for our simulator, gcc produced better results.

      --

      -- Erich

      Slashdot reader since 1997

  23. Re:40% faster kernel, but what overall performance by Jurily · · Score: 1

    We would then need to factor in how much time user applications spend in the kernel. Anything that is I/O-intensive is kernel-intensive.

    What do you mean? I don't think icc will speed up my hard drive.

  24. dunno exactly by emj · · Score: 1

    I might be completely wrong but:

    RMS felt that making it easy to produce plugins for GCC would be a very bad idea since closed source could exploit this. We really want GCC improvements to be free software so his hesitation has some merits.

    Exactly how this relates to LLVM I dunno..

    1. Re:dunno exactly by mrsbrisby · · Score: 1

      LLVM can (and is) used to subvert the GCC's GPL by making it possible to "compile" C code into closed-source proprietary bytecodes. See "Alchemy" for an example of Adobe being an immoral slimeball.

      I'd like to add a slimeball exception to software I've written, preventing Adobe from benefitting, and yet I can't bring myself to be immoral just to combat immorality.

  25. This is ancient by scientus · · Score: 2, Insightful

    This kernel is so ancient that any possible performance gains are outweighed by the new kernels performance, bug fixes, and improved driver support. Plus why would someone want to toss away their freedom by using a non-free compiler? Also, does the Intel compiler work with AMD processors?

    There is so much against this that it is useless, until Intel open sources, can work with up to date kernels, and can work on all x86 and x86_64 compatible hardware (im not sure if this is a problem) then im not interested.

    1. Re:This is ancient by Anonymous Coward · · Score: 0

      You don't even know the validity of your own objections? How can you expect to be taken seriously?

    2. Re:This is ancient by LingNoi · · Score: 1

      How can you throw away your freedom compiling free software sourecode on a non-free compiler? That makes no sense at all.

  26. Javascript by a09bdb811a · · Score: 1

    As a certified and accredited software engineer, I think it's time for Linux to be re-written in Javascript. The competition between Chrome, Firefox, IE and Safari has resulted in incredibly fast Javascript interpreters, and if Axl Torvalds mandates a switch to JS, the kernel could automatically take advantage of these improvements. After all, the OS and the web are becoming one, and within 10 years all applications will be in the cloud, delivered via the raintubes.

    1. Re:Javascript by MichaelSmith · · Score: 1

      As a certified and accredited software engineer, I think it's time for Linux to be re-written in Javascript. The competition between Chrome, Firefox, IE and Safari has resulted in incredibly fast Javascript interpreters, and if Axl Torvalds mandates a switch to JS, the kernel could automatically take advantage of these improvements. After all, the OS and the web are becoming one, and within 10 years all applications will be in the cloud, delivered via the raintubes.

      That way Apple will never be able to block you from booting Linux on the iPhone.

  27. Thank you, I look forward to trying this. by urbanriot · · Score: 1

    This is very relevant to my interests. We'd tried a while back to compile a Linux kernel with ICC and had too numerous issues to list. We do a lot of work with fluid dynamics and it's ALL CPU based - any increase in speed would be appreciated. With the economy the way it is, and a lot of companies shelving projects, budgeting for new clusters isn't on the list of priorities.

    1. Re:Thank you, I look forward to trying this. by gzipped_tar · · Score: 2, Informative

      I'm afraid the boost of kernel code won't help you much. Since you're doing fluid physics, I guess the hotspots are in the floating point math computation, and your code doesn't do context switching often. In that case, kernel speed isn't that important.

      Well, I'm just saying it. I hope I'm wrong :)

      --
      Colorless green Cthulhu waits dreaming furiously.
    2. Re:Thank you, I look forward to trying this. by thesupraman · · Score: 2, Insightful

      It depends, if the system is distributed, the hotspots (ie performance bottlenecks) could quite easily be in network latency and throughput, something that could be reasonably impacted here.

      Of course if its not, you are 100% right, however dont underestimate the proportion of cpu time the kernel spends in some situations (databases and distributed apps, for example).

    3. Re:Thank you, I look forward to trying this. by Slashcrap · · Score: 0

      It depends, if the system is distributed, the hotspots (ie performance bottlenecks) could quite easily be in network latency and throughput, something that could be reasonably impacted here.

      Sounds pretty fucking unlikely.

      Of course if its not, you are 100% right, however dont underestimate the proportion of cpu time the kernel spends in some situations (databases and distributed apps, for example).

      Oh yes, I expect it spends all that time doing the kind of SIMD floating point math that ICC will really help with. Not waiting on interrupts or mundane stuff like that.

  28. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 3, Informative

    There are actually quite a few ARM processors that do. See Jazelle.

  29. Re:GCC compatibility - Time to move to Java? by Ninnle+Labs,+LLC · · Score: 4, Informative

    Java is not a "systems language", meaning you don't write operating systems and systems level code in it for very good reasons.

    Funny cause Sun already did that like 13 years ago.

    One of them being, name me a processor that can run Java bytecode nativly.

    The ARM9E.

  30. Re:40% faster kernel, but what overall performance by jd · · Score: 1

    It won't speed up the hard drive, but it should reduce the latency of a context switch (something like 21 microseconds, isn't it?) and it should also reduce the latency involved in going through the various layers of the kernel.

    Yes, this isn't much in comparison to the speed of the drive, but that's not the point. I didn't say it would speed it up by a lot, merely that it would speed up.

    I don't know what the latency is within the kernel in the VFS layer or within the different filesystems (ignoring mechanical delays whether from reading the data or any metadata needed due to the FS algorithm), but I can be certain it won't be zero. I can also be certain that much of this latency won't be synchronized with the disk spinning, so it's not going to vanish in a spout of parallelism. Although I can't see any reason why this would be impossible if the FS and hard drive were designed in tandem. That's not the way it's usually done, though.

    The practical upshot is that using ICC and getting the 8% savings in the kernel might give you a 0.0008% improvement in performance (assuming no savings via the drive cache). Not a whole lot, certainly not enough to show on any but the most sensitive of disk I/O performance gauges, but it's still a saving.

    If the drive has an on-board RAM cache large enough to eliminate consideration of the mechanical components, then I/O savings would return to the more normal 8%.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  31. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 0

    These JVMs are able to dynamically optimize the running code in real-time, far beyond what could be achieved by C or C++ compilers, without any performance degradation.

    They can indeed do that for a great many algorithms. I recently worked on a huge number crunching application. There's a little throughput/sec display. It's amazing to see it keeping getting faster and faster when the JIT compilers keeps reordering the instructions.

    Regarding your ASM joke, HP's project Dynamo, 10 years ago, showed that the same could be done with ASM, beating any hand-crafted ASM you could ever dream of.

    *That said* the JVM does not provide anything to work with low-level DMA/IRQ/IO/etc. So good luck writing a fast kernel in ASM.

    A compliant JVM is indeed completely immune to buffer overrun.

    Oh, and Java does of course support multiple inheritance. In OO-Analysis and OO-Design implementation is completely secondary to modelization. Java supports multiple interface inheritance and hence Java supports OO's multiple inheritance concept in the cleanest, most abstracted, way possible. You're getting confused, like 99.9% of people out there discovering OO, by mistaking "concrete inheritance" (aka "implementation inheritance") for inheritance. There are entire frameworks, like Swing (used to power the Real World [TM]), that are entirely modelled using interfaces. There are also very fine OO languages that simply do not support "implementation inheritance", which should give you food for thoughts. Remember that in OO implementation is a detail and you'll be fine in the future.

    As a sidenote, implementation inheritance in Java (i.e. using the "extends" keywords on a *class*) can be seen as a quick way to use delegation. A quick and *dirty* way, for it shall make your program harder to maintain and harder to test.

    This is because 99.9% of people out there don't know what "abstraction" mean.

  32. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 0

    that really is hilarious - you know, I've known some people who would actually believe this too

  33. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 0

    Why is this funny? The overhead of separate virtual memory spaces (~20%) is roughly the cost of a JVM (~30%). A Java kernel is only funny because of network effects, existing C programs, that make it impossible in practice.

  34. Not only icc by Sits · · Score: 1

    Last year Rob Landley was working on getting the Tiny C Compiler to build the kernel unmodified (again by adding gccisms to tcc) - here's an OLS video of the Landley talking about changing tcc to compile the kernel. Alas, from what I gather this effort has stalled for now.

    It is unlikely that you will see the kernel adopting anything that makes the build process much more complicated. Operating system glue layers (e.g. abstractions in code for drivers that are supposed to run on other platforms) are already already frowned upon in drivers. Any new dependencies on tools like autoconf or cmake would most likely be rejected with a "what are we gaining?" complaint. My understanding is that patches that convert gccisms to their C99 equivalents are generally accepted but people are not willing to maintain glue for other compilers because it makes the default case painful. That's their choice - there are always other OSes like NetBSD that can be "compiler portable".

  35. Re:40% faster kernel, but what overall performance by geantvert · · Score: 1

    That's a common misconception but malloc is not a kernel call but a user land function.

    Malloc is implemented in the libc by managing a since large area of memory (the heap). When the heap is full, malloc() increases the heap size by a system call such as sbrk(). On my system (64bit), the heap is increased by blocks of 128KB.

    For large data sizes (>128KB) malloc does not use the heap and directly allocates the memory using the system call mmap().

    For example, for an application allocation up 100MB the overall number of calls to sbrk() is no more than 100MB/128KB = 800 regardless of the number of calls to malloc()/free() which can be millions. The kernel calls are totally negligible.

    There is a nice article here: http://www.linuxjournal.com/article/6390

       

  36. Re:Who cares? by TrancePhreak · · Score: 1

    Actually, there was that one that ran Windows...... so not _every_ supercomputer.

    --

    -]Phreak Out[-
  37. Re:40% faster kernel, but what overall performance by tmalsburg · · Score: 1

    The plain fact that the project started in 2004 and by now they can't state anything more precise doesn't make it appear very promising. The time would probably have been better invested in improving GCC.

  38. This is a good point by Sits · · Score: 1

    There are a few spots of the kernel that do use hand crafted SSE assembly (a quick glance says RAID calculation is one area (also here) and a particular crypto routine is another) but it is quite rare. Up until SSE4, SSE was really targeted at multimedia applications that contained a lot of floating point arithmetic. Generally floating point is avoided within the kernel so the maintenance pain of crafting an SSE optimised routine along with generic C version would not be worth it. Seemingly when you go to write assembly these days you have to account for the following:

    • Are you smarter than your compiler?
    • Will you still be smarter than it in a year's time?
    • Is it worth the time (both the initial and the maintenance time) to write the routine twice (in assembly and in generic C)?
    • Will your assembly still be faster when new processors with different properties come out?

    Also don't conclude that just because the kernel doesn't contain many handcrafted SSE routines that no SSE instructions will ever be emitted by the compiler (assuming you've told it that you have a CPU that can cope with them). I believe very new versions of GCC (4.3 and above) have the just gained the ability to emit SSE4 instructions.

    1. Re:This is a good point by emj · · Score: 1

      Wonder if there is refactoring advice for making code better translate to SSE-like instructions. And if there is, do you have the time to rewrite your code and datastructures to fit that?

  39. Re:GCC compatibility - Time to move to Java? by cerberusss · · Score: 3, Funny

    A Java kernel would likely run at least 50 times faster then the very best hand coded assembler

    I'm going to have to agree with you here. However with all the major browser producers concentrating on JavaScript speed recently, I'd say it's much better to use JavaScript instead of plain Java. Think about it, JavaScript is where the speediness is. Also, since almost every browser supports it, you could just boot the kernel using any browser. This could potentially get the kernel out of the hands of that bunch of self-righteous, elitist Linux hackers who are currently totally disconnected from users like you and I.~

    --
    8 of 13 people found this answer helpful. Did you?
  40. Final gcc should be no faster with icc by Sits · · Score: 1

    So the general answer is no it will not be faster. This is because as a final step (the so called stage3) it compiles itself with itself. This assumes icc isn't malicious (yes I know - Trusting Trust and Countering Trusting Trust etc).

    1. Re:Final gcc should be no faster with icc by TheThiefMaster · · Score: 1

      Well in that case, is the GCC created in stage 1 of compiling (the one that is compiled using another compiler, in this case ICC) faster than the stage 2 and 3 compilers (created by the ICC-compiled GCC and the GCC-compiled GCC respectively).

    2. Re:Final gcc should be no faster with icc by Sits · · Score: 1

      It's quite possible but it may also produce unexpected/unwanted results (remember it only has to be good enough to compile a compiler).

  41. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 1, Informative

    What a complete load of garbage:

    Don't get me wrong, I love Java and I'm a full time Java developer but here's why what you just said is a complete load of Tosh:

    1. JIT compilation is just doing a similar job to a C/C++ compiler only at run time. It's certainly not any better than the excellent ICC compiler and for an operating system which you would want to boot quickly would you really want it compiling half the OS at boot up?

    2. Most of Java's IO operations are just JNI wrappers for native C system calls anyway. Because Java has to be compatible with the APIs for all the different operating systems they make some nasty compromises in order to present a common interface. That means that Java IO is almost always alot slower than native IO.

    3. It's just a terrible idea! Java is a wonderful language but not for operating systems.

  42. Re:Good job by Anonymous Coward · · Score: 0

    Apparently so.

  43. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 0

    AVR32 can also run java bytecode natively.

  44. Re:Wasn't it just a couple of years ago... by Anonymous Coward · · Score: 0

    Man, if the world stood by and waited for Democrats to actually create solutions, we'd be in some kind of masssive global financial meltdown or something...

    Oh, wait...

  45. Re:Who cares? by LingNoi · · Score: 1

    Wow one out of 500.. awesome..

  46. Re:GCC compatibility - Time to move to Java? by Anonymous Coward · · Score: 0

    No, it doesn't. It just supports few of the commonly used byte codes and has instructions to optimize the common scenarios. It most certainly doesn't have a fullfledged native java byte code support.

  47. Why not fix the perf bugs first? by Anonymous Coward · · Score: 1, Interesting

    Hey, why doesn't anyone fix the notorious issues in the kernel first? Before playing around with some fancy new compiler... The kernel performance is broken for month, and nobody has fixed it yet. Here, when was this: last October! Last January! And it's still broken! http://it.slashdot.org/article.pl?sid=09/01/15/049201 http://linux.slashdot.org/article.pl?sid=08/10/27/1212214

  48. ... on their own hardware by reiisi · · Score: 1

    And that's a problem, and the reason this really isn't all that exciting.

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  49. -1 redundant? by reiisi · · Score: 1

    Sometimes a thing needs to be said more than once or twice.

    In this case, maybe it needs to be said several thousand times.

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  50. ARM and GCC by Anonymous Coward · · Score: 0

    Actually ARM has its own compiler, RVCT which constantly produces way faster and smaller code than the GCC for Symbian. See http://arm.com/products/DevTools/index.html for more info.

  51. Re:40% faster kernel, but what overall performance by Anonymous Coward · · Score: 0

    your disk controller and filesystem drivers do most of their stuff in the kernel, pumping megabytes of date to your hard drive requires these kernel subsystems (VFS, ...) to do a lot of work

  52. Re:GCC compatibility - Time to move to Java? by Ninnle+Labs,+LLC · · Score: 1
    Yes it does. ARM specifically touts the ARM9E family as running the bytecodes natively.

    The ARM926EJ-S processor also includes ARM Jazelle(TM) technology which enables the direct execution of Java bytecodes in hardware.

    I guess ARM is lying about their own products?

  53. GCC versus ICC by tjwhaynes · · Score: 1

    ICC is hands down the best C++ compiler for x86 and x64 from a performance perspective. GCC isnt even in the running on that front. All GCC has going for it is that its "free"

    Given that we get a few percent benefit from using ICC over GCC after heavy tuning, I'd say that GCC gets the job done pretty well, given that it is a general purpose, multiplatform compiler. And one thing ICC totally sucks at is compiling speed - ICC takes two to three times longer than GCC to compile and link code. When I need to test a feature today, you can guess which compiler I reach for, especially when GCC can take over an hour to complete some of the code bases here.

    Cheers,
    Toby Haynes

    --
    Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
  54. If you're going to go through all this effort to by kungfuj35u5 · · Score: 1

    instruct Gentoo users, why don't you just write an ebuild? After all, you did build this on Gentoo, why not add it into portage? There's not even an overlay!

  55. Re:GCC compatibility - Time to move to Java? by niteice · · Score: 1

    Java is a wonderful language

    I understand those words but not their meaning together.

    --
    ROMANES EUNT DOMUS
  56. ROUTING by Chris+Snook · · Score: 1

    The HPC and gaming communities probably won't care much about this, aside from the tweakers who spend $500 to overclock a $200 CPU to perform like a $400 CPU. The vast majority of workloads spend very little time in the kernel. The glaring exception to this is the network stack, where you can have a lot of rather CPU-intensive packet-mangling, routing, firewalling, IPSEC tunneling, and header processing done entirely in kernelspace. Ever try saturating a 10 Gbit ethernet interface? If you don't do some careful tuning, it quickly becomes CPU-bound, and much of that tuning is application-specific, so it's not much help when the applications generating the traffic are running remotely and beyond your control. Now try saturating two of them. Or more. This is one of the reasons why most people don't use Linux for high-end routing, but if it were possible, a lot of people would be very thrilled to move from things like IOS to something where they can use less exotic management tools that don't require such expensive training and support, and where there's much less vendor lock-in.

    --
    There's no failure quite as dissatisfying as a complete and total solution to the wrong problem.
  57. Mod parent down by INowRegretThesePosts · · Score: 1

    Its their compiler, they are damn well allowed to do what they want - call me when AMD pour that kind of resource into having their own compiler.

    This sort of "a company can do anything it wants with its own products" comments appear almost every time someone mentions anti-competitive behavior, and then people explain that no, a company should not be allowed to leverage a monopoly position to further entrench itself. Should the government allow practices like, e.g., dumping, the market would be dominated by a very small number of mega-corporations, ruining the economy.

    Seriously, are you a troll?

  58. Re:GCC compatibility - Time to move to Java? by XDirtypunkX · · Score: 1

    50 times faster than the best hand coded assembler? I can't tell if you're being sarcastic or you really do think that it's possible to make any compiled code run better than the "best" assembler.

    If a JVM can produce the machine code, so can a human produce it by hand coding in assembly.

  59. Re:GCC compatibility - Time to move to Java? by ta+bu+shi+da+yu · · Score: 1

    Oh brother. Comparing virtual memory spaces to JVMs. Only on slashdot.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  60. Re:GCC compatibility - Time to move to Java? by ta+bu+shi+da+yu · · Score: 1

    Sure... given that the compiled code basically gets broken into a set of instructions that are encoded using an executable format, the same way that assembly code gets broken into a set of instructions that are encoded using an executable format.

    Seriously, most non-trivial programs are better optimized by the compiler. Humans miss stuff, and often don't optimize very well anyway.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  61. Re:GCC compatibility - Time to move to Java? by XDirtypunkX · · Score: 1

    Yeah, non trivial programs. But no one said you have to write the whole non-trivial program in assembly. Sure, a human can't optimize code better than a compiler in will without a great deal more effort.

    However a human can focus on the areas (time critical inner loops) that need optimization and do it when necessary. And there are still things a determined human can do better than a compiler. Things like avoiding branches with flag / conditional move tricks, vectorizing complex floating point operations and using a few instruction tricks to get a loop into a cache line are all things a human can still do better.

    In general, you should let the compiler have a go first though and see if you can do better if it's really needed. Of course, if you're some kind of "enterprise" coder, it's not needed. However, if you're writing something that is really performance critical (games, especially on portable platforms, or certain kinds of scientific computing), you should get your hands dirty if performance isn't quite up to snuff.

    Note you don't have to use assembly so much anymore, much of the available low level functionality is available through special machine level intrinsics (especially in the case of SSE) on modern compilers.