Slashdot Mirror


Linux May Need a Rewrite Beyond 48 Cores

An anonymous reader writes "There is interesting new research coming out of MIT which suggests current operating systems are struggling with the addition of more cores to the CPU. It appears that the problem, which affects the available memory in a chip when multiple cores are working on the same chunks of data, is getting worse and may be hitting a peak somewhere in the neighborhood of 48 cores, when entirely new operating systems will be needed, the report says. Luckily, we aren't anywhere near 48 cores and there is some time left to come up with a new Linux (Windows?)."

28 of 462 comments (clear)

  1. Original Source and Actual Paper by eldavojohn · · Score: 5, Informative

    It appears that the problem, that affect the available memory in a chip when multiple cores are working on the same chunks of data, is getting worse and may be hitting a peak somewhere in the neighborhood of 48 cores, when entirely new operating systems will be needed, the report says.

    Seriously? You picked that over my submission?

    I submitted this earlier this morning I guess my submission was lacking. But if you're interested in the original MIT article and the actual paper (PDF):

    eldavojohn writes "Multicore (think tens or hundreds of cores) will come at a price for current operating systems. A team at MIT found that as they approached 48 cores their operating system slowed down. After activating more and more cores in their simulation, a sort of memory leak occurred whereby data had to remain in memory as long as a core might need it in its calculations. But the good news is that in their paper (PDF), they showed that for at least several years Linux should be able to keep up with chip enhancements in the multicore realm. To handle multiple cores, Linux keeps a counter of which cores are working on the data. As a core starts to work on a piece of data, Linux increments the number. When the core is done, Linux decrements the number. As the core count approached 48, the amount of actual work decreased and Linux spent more time managing counters. But the team found that 'Slightly rewriting the Linux code so that each core kept a local count, which was only occasionally synchronized with those of the other cores, greatly improved the system's overall performance.' The researchers caution that as the number of cores skyrockets, operating systems will have to be completely redesigned to handle managing these cores and SMP. After reviewing the paper, one researcher is confident Linux will remain viable for five to eight years without need for a major redesign."

    I don't know, guess I picked a bad title or something?

    Luckily we aren't anywhere near 48 cores and there is some time left to come up with a new Linux (Windows?).

    Again, seriously? What does "(Windows?)" even mean? As you pass a certain number of cores, modern operating systems will need to be redesigned to handle extreme SMP. It's going to differ from OS to OS but we won't know about Windows until somebody takes the time to test it.

    --
    My work here is dung.
    1. Re:Original Source and Actual Paper by VorpalRodent · · Score: 4, Funny

      What does "(Windows?)" even mean?

      I read that as saying "Windows is the new Linux!". Clearly the submitter is trying to incite violence in the Slashdot community.

      --
      Take it to the limit, everybody to the limit, come on, everybody fhqwhgads.
    2. Re:Original Source and Actual Paper by Dragoniz3r · · Score: 4, Interesting

      Oh look, CmdrTaco published yet another story with a poorly-written, hypersensationalist summary! Par for the course.

    3. Re:Original Source and Actual Paper by klingens · · Score: 5, Interesting

      Yes it is lacking: it's too long for a /. "story". Editors want small, easily digested soundbites, not articles with actual information.

    4. Re:Original Source and Actual Paper by eudaemon · · Score: 5, Informative

      I just laughed at the "we aren't anywhere near 48 cores" comment - there are already commercial products with more than 48 cores now. I mean even a crappy old T5220 pretends to have 64 CPUs due to the 8 CPU, 8 thread design.

    5. Re:Original Source and Actual Paper by Perl-Pusher · · Score: 4, Insightful

      Core !=CPU

    6. Re:Original Source and Actual Paper by NevarMore · · Score: 4, Interesting

      The thing is eldavojohn practically *is* an editor for /. , just check out his submission page. Despite having such a high UID he's got a solid reputation, a good writing style, and offers good commentary on a wide variety of topics.

    7. Re:Original Source and Actual Paper by BeardedChimp · · Score: 4, Informative

      The purpose of an editor is to edit any submissions to make them ready for print.

      If the summary was too long, the editor should have got off his arse rather than wait for the summary that fits the word count to come along.

    8. Re:Original Source and Actual Paper by Captain+Splendid · · Score: 4, Insightful

      Which is why he's treated like shit: Can't have any kind of excellence here, Taco wants to keep that old-school newsgroup feel. That's the only explanation that still fits.

      --
      Linux, you magnificent bastard, I read the fucking manual!
    9. Re:Original Source and Actual Paper by spazdor · · Score: 5, Insightful

      The very act of summarization constitutes an act of commentary. You're saying "I think the pertinent parts of this story are these, and the most important questions raised are those."

      A good summary invites commentary and frames the questions in a way which makes for better discussion, but don't for a second imagine the OP ought to be value-neutral (if such a thing could even exist.)

      --
      DRM: Terminator crops for your mind!
    10. Re:Original Source and Actual Paper by monkeySauce · · Score: 4, Informative

      The article is about cores per chip, not cores per system.

      You're trying to compare a 48-cylinder engine with a bunch of 4-cylinder engines working together.

    11. Re:Original Source and Actual Paper by drsmithy · · Score: 4, Insightful

      I was kind of wondering about the "modern operating systems" comment... I think he meant "desktop operating systems".

      What's a "desktop operating system" these days ? The only mainstream OS that hasn't seen extensive use and development in SMP server environments for a decade plus is OS X. For all the others, "desktop" vs "server" is just a matter of the bundled software and kernel tuning.

      Even OS/2 could scale to 1024 processors if I recall correctly.

      Yeah. Just like those old PPC Macs were "up to twice as fast" as a PC.

    12. Re:Original Source and Actual Paper by hardburn · · Score: 4, Insightful

      Trolling, I'm sure, but to people who take "GNU/Linux" seriously: how much of any given distro is really GNU code anymore? While GNOME may still be preferred by Ubuntu, there are also a lot of Kbuntu users, and many other distros seem to prefer KDE. Neither XFree86 nor X.Org were ever GNU. Smaller installations, like smartphones and home gateways (which often do run Linux, even if you can't install a custom version like DD-WRT), use busybox for their basic command line tools, and almost certainly do not use glibc. Debian even went for the eglibc fork, partially because Ulrich Drepper makes Theo DeRaadt look like a nice guy. HURD has gone nowhere for 20 years now, even if it does have some neat ideas.

      Non-GNU GUI applications and libraries now make up a huge percentage of a desktop distro, Apache and custom web apps make up a big chunk of server code, and smartphones may or may not have any GNU code at all.

      So what's left of GNU code now? Well, gcc is likely to keep being the world's de facto C compiler (though even this was mainly because of the egcs fork way back when). I'm sure there will be legions of emacs users for years to come, and I guess a lot of people still prefer GNOME. GNU's basic command line tools and bash will no doubt still be used on servers and desktops. But is this really sufficient to warrant a "GNU/Linux" nomenclature, not to mention all the pedantry that surrounds it?

      To the AnonCow troll above: GNU code has nothing to do with how the kernel handles multicore processors, so your whole point is moot within this context.

      --
      Not a typewriter
    13. Re:Original Source and Actual Paper by dAzED1 · · Score: 5, Informative

      and YET...that's irrelevant, because as many people have pointed out the problem is the cores that share L2 cache. There have been large systems with many, many processors for a long time, some of which run Linux. The problem that was described was 48cores on a single die, sharing the same cache. Sun's die-to-die tech isn't relevant to this problem, nor is putting more than 6 8-core CPUs in a single system.

    14. Re:Original Source and Actual Paper by dgatwood · · Score: 4, Informative

      Well, gcc is likely to keep being the world's de facto C compiler (though even this was mainly because of the egcs fork way back when).

      Actually, I doubt that is true. At this point, the commercial UNIX vendors and the BSDs seem to be putting their weight behind Clang/LLVM/LLDB, in large part due to GCC going GPLv3. In addition to being a cleaner architecture that's easier to enhance than GCC, it is also faster, and it often produces much better code as well. The GNU toolchain's days as the de facto standard are numbered, IMHO.

      Back on topic, it occurs to be that large clusters with hundreds of cores start to inherently behave a lot more like NUMA and really need to be treated that way. Note that lots of modern OSes, including Linux, have supported NUMA in the past, so suggesting that it requires a completely rewritten OS is a preposterous assertion. That's not at all what this article is saying. What this article is saying is that tasks often are not easily divisible into tasks small enough to take advantage of multiple cores, and that managing processor affinity to ensure that threads working on the same data are run on the cores within the same physical die starts to become an unmanageable problem past a certain point.

      In effect, what it is saying is that barring interconnect improvements, for many classes of problems, the performance penalty caused by multiple cores needing to access the same data exceeds the performance gain from adding additional cores at or around 48 cores. No OS change will help this, and in many cases, no software changes can help this, either. Most computing tasks are simply not massively parallelizable. This conclusion should be entirely expected by anybody who has ever tried to parallelize software to any real degree, but it's always good to see studies that bear out.

      Put another way, once you exceed about 48 cores, the cores start to act more like clusters than cores. You start to see more and more accesses in which one CPU has to force data out of another CPU's cache. The nonuniformity of memory accesses starts to dominate the access times. Thus, past about that point (and probably much lower for most problems), adding more cores no longer improves performance. Even for massively parallelizable problems like video compression, once you exceed a certain number of nodes doing the work, the time spent assembling the final data actually exceeds the performance win achieved by adding additional processing nodes. This is completely straightforward, completely understood by real-world computer programmers, and shouldn't really be a surprise to anyone.

      I'm not convinced an OS change can fix this, nor even an architectural change, though both can help to some degree by making parallelization easier (e.g. by providing APIs for supporting work units arranged in a dependency graph like GCD as an alternative to raw thread-based APIs). At some point, though, you're bounded by the number of distinct pieces that a problem can be divided into that don't depend on the output of any other piece, and once you hit that limit, adding additional computational units can only hinder performance, not help it. Your only real choices, then, are to find new and interesting ways to refactor the problem so that this is no longer the case, to change the structure of the input data to remove dependencies, to increase the speed of the individual CPU cores, or to turn the machines loose processing more than one problem at any given time to keep the remaining cores occupied.

      Oh, yeah, and there's one other change that helps a lot: keep your read-only data in read-only pages, and write your code so that results go somewhere else. Read-only pages can be cached in every CPU without any real cache coherency overhead, at least in theory (I'm assuming that most modern CPUs do this), which means that input data sharing between CPUs doesn't matter. This design, combined with lockless work unit APIs, can make a huge difference in how many CPU

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    15. Re:Original Source and Actual Paper by joib · · Score: 4, Informative

      Unfortunately, the summary as well as the short articles on the web were more or less completely missing the point. The actual paper ( http://pdos.csail.mit.edu/papers/linux:osdi10.pdf ) explains what was done.

      Essentially they benchmarked a number of applications, figured out where the bottlenecks were, and fixed them. Some of the things they fixed where done by introducing "sloppy counters" in order to avoid updating a global counter. Others were to switch to more fine-grained locking, switching to per-cpu data structures, and so forth. In other words, pretty standard kernel scalability work. As an aside, a lot of the VFS scalability work seems to clash with the VFS scalability patches by Nick Piggin that are in the process of being integrated into the mainline kernel.

      And yes, as the PDF article explains, the Linux cpu scheduler mostly works per-core, with only occasional communication with schedulers on other cores.

  2. Error in their math by El_Muerte_TDS · · Score: 5, Funny

    They have an one-off error in their math, it's actually 9 times a 6 core CPU. So, at 42 cores a rewrite is needed.

  3. Re:Linux already runs on thousands of cores by Gaygirlie · · Score: 4, Interesting

    It's not the case of not being able to do such, but instead about where there are performance regressions. Of course it's possible to run Linux on multiple hundreds of cores, but it seems that after 48 cores there is a performance regression and thus all those cores don't benefit as much as they could. That is the issue here.

  4. What are they talking about by pclminion · · Score: 4, Insightful

    Can somebody please explain what the fuck they are actually talking about? They've dumbed down the terminology to the point I have no idea what they are saying. Is this some kind of cache-related issue? Inefficient bouncing of processes between cores? What?

    1. Re:What are they talking about by jd · · Score: 5, Informative

      What they are talking about really reduces to a variant of Ahmdals Law, but simply put scaling is always non-linear. There will be overheads per core for communication (why is why SMP over 16 CPUs is such a headache) and overheads per core within the OS for housekeeping (knowing what core a specific thread is running on, whether it is bound to that core, etc, and trying to schedule all threads to make best use of the cores available).

      The more cores you have, the more state information is needed for a thread and the more possible permutations the scheduler must consider in order to be efficient. Which, in turn, means the scheduler is going to be bulkier.

      (Scheduling is a variant of the box-packing problem, which is an NP-Complete problem, but it has the added catch that you only get a very short time to pack the threads in and scheduling policies - such as realtime and core-binding - must also be satisfied in addition to packing all the threads in.)

      The more of this extra data you need, the slower task-switching becomes and the more of the cache you are hogging with stuff not actually tied to whatever the threads are actually doing. At some point, the degradation in performance will exactly equal the increase in performance for the extra cores. The claim is that this happens at 48 cores for modern OS'. This is plausible but it is unclear if it is an actual problem. Those same OS' are used on supercomputers of 64+ cores, by segregating the activities in each node. MOSIX, Kerrighd and other such mechanisms have allowed Linux kernels to migrate tasks from one node to another transparently. (ie: You don't know or care where the code runs, the I/O doesn't change at all.) The only reason Linux doesn't have clustering as standard is that Linus is waiting for cluster developers to produce a standard mechanism for process migration that also fits within the architectural standards already in use.

      If you clustered a couple of hundred nodes, each with 48 cores, you're looking at having around 2000+ on the system. It wouldn't take a "rewrite" per-se, merely a few hooks and a standard protocol. To support a single physical node with more than 48 cores, you might need to split it into virtual nodes with 48 or fewer cores in each, but Linux already has support for virtualization so that's no big deal either.

      --
      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)
  5. 48 cores? by drunkennewfiemidget · · Score: 4, Funny

    I'm still waiting for Windows to work well on ONE.

  6. seeing as Linux does 10240 cores already, WTF? by r00t · · Score: 4, Interesting

    No kidding. SGI's Altix is a huge box full of multi-core IA-64 processors. 512 to 2048 cores is more normal, but they were reaching 10240 last I checked. This is SMP (NUMA of course), not a cluster. I won't say things work just lovely at that level, but it does run.

    48 cores is nothing.

  7. Re:Linux already runs on thousands of cores by DrgnDancer · · Score: 4, Informative

    I thought this as well, but after more carefully reading the article, I *think* I see what the problem is. It's not really a problem with large numbers of cores in a system, so much as a problem with large numbers of cores on a chip. Since the multicore chips share caches (level 2 cache is shared, level 1 cache isn't IIRC, but I could be wrong) it's actually cache memory where the issue lies. I've worked on single system image SGI systems with 512 cores, but those systems were actually 256 dual core chips. That works fine, and assuming well written SMP code performance scales as you'd expect with number of cores.

    --
    I don't need a million points of light, just two points of multi-mode fiber and a 10 Gig-E router.
  8. Re:based on a 1970s OS and language by geekoid · · Score: 4, Insightful

    Hahaha. Oh arrogances from ignorance, how I loath you.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  9. Just the cache problem by Todd+Knarr · · Score: 4, Informative

    What they're saying is basically two things:

    First, there's a bottleneck in the on-chip caches. When a core's working on data it needs to have it in it's cache. And if two cores are working on the same block of memory (block size being determined by cache line size), they need to keep their copies of the cache synchronized. When you get a lot of cores working on the same block of memory, the overhead of keeping the caches in sync starts to exceed the performance gains from the additional cores. That's not new, we've known that in multi-threaded programming for decades: when you've got a lot of threads dependent on the same data items, the locking overhead's going to be the killer. And we've known the solution for just as long: code to avoid lock contention. The easiest is to make it so you don't have multiple threads (cores) working on the same (non-read-only) memory at the same time, that just requires some thinking on the part of the developers.

    Second, you only gain from additional cores if there's workload to spread to them usefully. If you've got 8 threads of execution actually running at any given time, you won't gain from having more than 8 cores. And on modern computers often we don't have more than a few threads actually using CPU time at any given moment. The rest are waiting on something and don't need the CPU and, as long as we aren't thrashing execution contexts too badly, they can be ignore from a performance standpoint. To take advantage of truly large numbers of cores, we need to change the applications themselves to parallelize things more. But often applications aren't inherently multi-threaded. Games, yes. Computation, yes. But your average word processor or spreadsheet? It's 99% waiting on the human at the keyboard. You can do a few things in the background, file auto-save and such, but not enough to take advantage of a large number of cores. The things that really take advantage of lots of cores are things like Web servers where you can assign each request to it's own core. And no, browsers don't benefit the same way. On the client side there are so (relatively) few requests and network I/O's so slow relative to CPU speed that you can handle dozens of requests on a single core and still have cycles free assuming you use an efficient I/O model. But it all boils down to the developers actually thinking about parallel programming, and I've noticed a lot of courses of study these days don't go into the brain-bending skull-sweat details of juggling large numbers of threads in parallel.

  10. K42: these problems were already tackled by compudj · · Score: 5, Informative

    The K42 project at IBM Research investigated the benefit of a complete OS rewrite with scalability to very large SMP systems in mind. This is an open source operating system supporting Linux-compatible API and ABI.

    Their target systems, "next generation SMP systems", back in 2003 seems to have become the current generation of SMP/multi-core systems in the meantime.

  11. So what the fuck is he doing here then? by SmallFurryCreature · · Score: 5, Funny

    Lets drive the greenhorn OUT! No filthy high UID's with their spelling and gramar and solid well researched non-sensationlist writing. I want my editors to rape the language (bonus points if it is several languages at once) and sent my heart racing by raising my bile and fear of the unknown and known.

    Headlines sell adverts. Truth, accuracy, honesty do not. Accept it, you are reading slashdot, it works.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.