Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming Software Linux IT Technology Entertainment Games

The Completely Fair Scheduler's Impact On Games 315

eldavojohn writes "We've heard a bit about the completely fair scheduler previously, but now Kernel Trap looks at the implications this new scheduler has for 3D games in Linux. Linus Torvalds noted, 'I don't think any scheduler is perfect, and almost all of the time, the RightAnswer(tm) ends up being not one or the other, but somewhere in between. But at the same time, no technical decision is ever written in stone. It's all a balancing act. I've replaced the scheduler before, I'm 100% sure we'll replace it again. Schedulers are actually not at all that important in the end: they are a very very small detail in the kernel.' The posts that follow the brief article, reveal that Linus seems quite confident that he made the right choice in his decision to merge CFS with the Linux kernel. One thing's for certain, gaming on Linux can't suffer any more setbacks or it may be many years before we see FOSS games rival the commercial world."
This discussion has been archived. No new comments can be posted.

The Completely Fair Scheduler's Impact On Games

Comments Filter:
  • by DaedalusHKX ( 660194 ) on Tuesday July 31, 2007 @12:32PM (#20059105) Journal
    I have Windows XP and Gentoo Linux running side by side, and strangely, Gentoo scores 10 to 12 FPS faster in World of Warcraft, Warcraft III and even Doom 3. Granted they are commercial games, but if they can run in WINE that fast, I wonder what a direct Linux implementation would do. I just love seeing folks buying the headlines instead of blazing their own paths.

    That's why the world is in the shape its in... the majority is always waiting for someone to save the day. You want desktop Linux? Then make it your desktop. Otherwise stop bitching and post some valid comments.
  • Scheduler Nanokernel (Score:3, Interesting)

    by Doc Ruby ( 173196 ) on Tuesday July 31, 2007 @12:43PM (#20059259) Homepage Journal
    Schedulers are actually not at all that important in the end: they are a very very small detail in the kernel - Torvalds
    Actually, I'd like to see the OS kernel consist entirely of only the scheduler and the thinnest APIs to secure drivers granting access to the HW. Everything else, including IPC, could be in userspace.

    That would make distributing the OS a lot easier. And the simplicity could be a lot easier to secure, to develop for, to customize a deployment for minimum HW (like eg. a "self-winding" 10mW Bluetooth ring with "accessory" features). Practically every device could run the same "OS", with modules bolted on for increased functionality on heavier HW.
  • by Anonymous Coward on Tuesday July 31, 2007 @12:55PM (#20059427)
    Con's SD scheduler is light years ahead in terms of desktop computing and gaming. The "Completely Fair" Scheduler is not. Linus made a poor political decision that once again favors the multi-CPU, gobs of memory, server architecture that normal people don't give two shits about.
  • Re:FOSS games (Score:4, Interesting)

    by OldeTimeGeek ( 725417 ) on Tuesday July 31, 2007 @01:01PM (#20059515)
    Aren't going to happen until artists in the medium, 'good' artists rather, decide to start working for free the same way coders do. Some artists will work for publicity alone, bu they seem to be by far in the minority.

    Of course they're in the minority. For them, there's nothing to be gained in providing their services for free.

    The publicity for working on games is almost nonexistent. For example, can you, name any artist that worked on any one of the most popular games? I can, but I know a bunch of artists that work in the games industry.

    Besides, artwork doesn't work as FOSS. Unlike code, artwork for games isn't inherently "sharable" - it's designed for the purposes of that game and that game only. Game engines can be used for multiple different kinds of game. Artwork almost always can't. It may be used for sequels (but generally isn't as the requirements change from game to game) but it can't be used across different types of games.

  • by Anonymous Coward on Tuesday July 31, 2007 @01:14PM (#20059731)
    You are on to something here. CK uses arrays and has a lower context switch time whereas CFS uses red-black trees. What this means is that doing a bunch of "while :; do done" loops that always use their full timeslice is a test that favors CFS as much as possible really.

    As an aside, what kind of retard benchmarks a scheduler using a game that is doing nothing and 100% cpu tasks? Put some disk access in there, maybe a set of folders that will easily fit in cache and then find . them. Have some fixed-seed random busy / sleeps of different ratios. Have the game play a demo reel on repeat and record avg *and* min/max fps. Come on Ingo must be somewhat familiar with CK so he must know that these tests where CK is roughly the same are biased toward CFS to begin with. If you are going to say 'look I did these benchmarks and it's a wash' and use that as a justification then at least do good benchmarks.

    I think this more than anything else confirms my impression than Ingo is just hacking shit until it kinda works ok. Note that this is exactly the same kind of rationale Linus gave for diss'ing Con so flame off.
  • by garett_spencley ( 193892 ) on Tuesday July 31, 2007 @01:21PM (#20059865) Journal
    Besides, the biggest barrier to 3d games in Linux is video card drivers (ATI, I'm looking at you!) as 3D drivers in Linux, even the proprietary ones, have tended to be unstable.

    I would think that the biggest barrier to 3d games in Linux would be the inherent paradox concerning the lack of 3d games.

    No gamers = No profit for game companies = No games being produced.
    No games = No gamers = No profit for game companies.

    The one thing that I would agree on is that video card support brings game developers and gamers closer to a certain extent. Having better drivers might get both gamers and developers to consider Linux a *little* more. However, even if Linux had terrific video card drivers that were just as good or better than the Windows drivers I still wouldn't consider Linux for games just because there's very few good games available.

    Better drivers can only help. But I can't consider that the "biggest" problem. The biggest problem is that there are too few people who use Linux. So video card manufacturers don't care about Linux. Game developers don't care about Linux and lastly (most) gamers don't care about Linux.

    I realize there was a lot of bad management decisions involved, but look at what happened to the last company that tried to make a business out of porting titles to Linux (*cough* Loki *cough). I have just about every Loki title that was developed and I really wish they had stayed afloat. Maybe it was bad business decisions and maybe it was just that there was no profit in porting titles to Linux. The situation might be different today and I hope that someone has the desire, balls and money to step up and try what Loki tried 7 or 8 years ago. But Loki's fate did send a clear message. There's no profit in Linux games. John Carmack also said back then that releasing Q3A for Linux saw no profit.

    Hopefully as more desktop companies, like Dell, jump on board and push Linux then maybe both the game developers and video card manufacturers will start to see the potential for profit and a result gamers will jump on board. But even Mac has suffered from the same problem for 20 years, and there's way more profit in developing for Mac than Linux. And it shows. There are more commercial Mac games than there are Linux. But both Linux and Mac have next to no games at all when you compare to the titles available for Windows.
  • The X Factor (Score:5, Interesting)

    by mcelrath ( 8027 ) on Tuesday July 31, 2007 @01:24PM (#20059897) Homepage

    I keep wondering...X is a single threaded server, communicating with a (generally) single threaded game. Worse, wine inserts the wineserver process, so I have three single threaded things trying to synchronize to get interactivity. A low latency event like a keypress might require all three processes to be scheduled in succession, to get a response on the screen. A poor man's way to do this is with the kernel's scheduler, but a far superior way to do it is to have multiple threads in the X server. Scheduling an interactive event isn't hard. Getting crap on the screen in the same scheduling timeslice is hard (impossible?) since it requires a second scheduling point. As I understand, this is how BeOS achieved substantial interactivity in the presence of load -- my having a multi-threaded graphics server *and* kernel.

    So, how much can be gained by rewriting X, or going to a different graphics server? Or do I completely misunderstand the effect of X?

    -- Bob

  • Jitter is important (Score:5, Interesting)

    by dybdahl ( 80720 ) <info AT dybdahl DOT dk> on Tuesday July 31, 2007 @01:38PM (#20060107) Homepage Journal
    Usability research has shown, that variation in waiting time is actually a bigger irritation for users than waiting time itself.

    I have seen several projects, where user interface response time problems have been "improved" by making adding a minimum response time. The average response time increases, but variation decreases, and the user often reports the program as having become faster... the logic to this seems to be, that the user wants the user interface to have a predictable response.

    I think the reference for this is Søren Lauesens books about usability programming, but I cannot remember for sure right now.
  • by kisielk ( 467327 ) on Tuesday July 31, 2007 @02:23PM (#20060849)
    Not only is it possible, but it's widely used in many RTOS. For example QNX lets you select scheduling algorithms on a per-thread basis: http://www.qnx.com/developers/docs/6.3.0SP3/neutri no/prog/overview.html#SCHEDS [qnx.com]
  • by hey! ( 33014 ) on Tuesday July 31, 2007 @02:30PM (#20060963) Homepage Journal
    Well, the issue at hand here isn't throughput, it is consistency.

    An efficient scheduler gives processes in general the most bandwidth. A fair scheduler gives processes in a priority class the most equal bandwidth shares. A real time scheduler gives any given process the most predictable wait for bandwidth.

    Each of these notions is somewhat different. Achieving a high frame rate over the course of a test on an unloaded system tells you nothing about the scheduler, other than perhaps it is not truly awful. On a moderately loaded system, the scheduler may be giving your game more than its share of CPU time, but if from time to time your game seizes up for a fraction of a second, it would be an irritation, even if on average it's getting enough bandwidth to give you a good playing experience. At the same time, this situation would be fine for data processing applications like image analysis, where an operation might take several seconds, or even minutes to complete. As long as the process gets plenty of cycles over the course of the operation, it's ok, even though your operation might have "frozen" for up to a second in the process.
  • Re:FOSS games (Score:2, Interesting)

    by G Morgan ( 979144 ) on Tuesday July 31, 2007 @02:45PM (#20061155)
    Ever heard of MMORPG's? What's to stop one of them being driven by FOSS. Still a service model and can make money as a result.
  • by root_42 ( 103434 ) on Tuesday July 31, 2007 @02:50PM (#20061229) Homepage
    Well then, everyone, let's head over to Project Peach: http://peach.blender.org/ [blender.org]

    Yes, the blenderheads are at it again, and they are doing a game this time...
  • by root_42 ( 103434 ) on Tuesday July 31, 2007 @02:54PM (#20061265) Homepage
    D'oh! I am in Homer-Mode again. Of course I didn't mean PEACH, I meant the Apricot project: http://www.blender.org/blenderorg/blender-foundati on/2007-plans/apricot-open-game/ [blender.org]

    All those fruits... :-)
  • by Anonymous Coward on Tuesday July 31, 2007 @05:20PM (#20063215)
    I think that could be emulated by the window manager renicing programs on the fly.
  • Re:The X Factor (Score:3, Interesting)

    by renoX ( 11677 ) on Wednesday August 01, 2007 @02:06PM (#20074701)
    [[I don't know how many of the calls need to go back to the X server, but my guess is only the ones dealing with windowing and user input.]]

    Well the GP was talking about pressing a key, so that's definitedly user input..
    And the latency for the reaction to user input is quite critical for a game, but does the kernel --> X server --> games context switches induce really a measurable latency for a player?
    I don't know..

2.4 statute miles of surgical tubing at Yale U. = 1 I.V.League

Working...