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."
Strange, I've been gaming in Linux for years. (Score:5, Interesting)
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)
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.
This was already a known issue (Score:1, Interesting)
Re:FOSS games (Score:4, Interesting)
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.
Re:Article is misleading (Score:5, Interesting)
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.
Re:Article is misleading (Score:5, Interesting)
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)
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)
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.
Re:Article is misleading (Score:3, Interesting)
Re:Strange, I've been gaming in Linux for years. (Score:4, Interesting)
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)
Answer: Project Peach (Score:3, Interesting)
Yes, the blenderheads are at it again, and they are doing a game this time...
Re:Answer: Project Peach (Score:3, Interesting)
All those fruits...
Re:Other OS schedulers? (Score:1, Interesting)
Re:The X Factor (Score:3, Interesting)
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..