11 ms·
Linus Torvalds: Linux Scheduler Not to Blame for Google Stadia Port Issues
- falcolas 7y agoAs someone who has played Doom 2016 (and a bevy of other games from Steam) on Ubuntu at 4k 60fps, I strongly doubt that it's Linux. Wine/proton and the accompanying libraries are pretty f'ing amazing.
- buster 7y agoIndeed, i remember that i was wondering very much, when i found that Doom3 ran noticably smoother on Linux than on Windows on the same machine. I think i was even using wine back then.
- dingo454 7y agoI use some CAD/CAM programs on Wine and they're sensibly faster in both rendering and general usage compared to a windows install (I have a dual boot system). I can only complain about some minor font rendering issues and the lack of child window rendering [0] which is frequently used in programs like these. Once child window rendering is fixed, I will actually be considering ditching windows entirely and go wine-only. [0] https://www.winehq.org/pipermail/wine-devel/2019-July/148639.html https://www.winehq.org/pipermail/wine-devel/2019-July/148639...
- gnulinux 7y agoI noticed this as well. Old Windows programs, like programs from XP era and earlier ran better in Wine than Windows 7 back when I was experimenting with Wine.
- cptskippy 7y agoI wonder if that's due to the change in the way Apps are composited. In the pre Windows Vista Era, the operating system handed control over to the App to draw itself on screen. In Vista they moved to a model, like OSX, where each App drew to a buffer and the OS composited those buffers. That's part of the reason why Vista was hot steaming garbage because they were still working that transition out.
- CodeArtisan 7y agoIIRC, Borderlands 2 was running better on Wine than on Windows due to the underlying filesystem (ext4 vs ntfs).
- lokedhs 7y agoBorderlands 2 is native Linux so there is no need to use Wine. It would be interesting to see the difference in performance between running the native version and the emulated version.
- gnulinux 7y agoThey're very amazing, it feels truly magical, but in my experience, they're very fragile. Back in ~2014/2015 I was able to play Skyrim on my trash cheap laptop in Archlinux (don't remember the settings and fps, but the game ran "flawlessly" for me, yet I need to admit I'm not a gamer so I can't tell the difference between 30fps 60 fps etc). I tried the same in 2018 just for fun and I wasn't able to run Skyrim, there was always some minor issues that made the game unplayable, like mouse not working, crashing on certain screens etc. I essentially kept trying older versions of Wine, and eventually found some version that made Skyrim playable (still not as flawless as it felt in 2015, but playable). Idk if it was my mistake, or some archlinux lib weirdness or something else, but I had to try dozens of wine versions to find something that worked. This is fine for me, since I wasn't intending to play Skyrim, I was just trying to run it (for the "WOW" effect), but I imagine people who actually need Windows software might have been frustrated by this.
- toyg 7y agoIf i remember correctly, if you need wine for work, you pay for Crossover, which is supported better.
- throwthisaway2 7y agoThey are almost as magical as windows xp... almost
- falcolas 7y agoFWIW, I've found that using the Steam launcher eliminated any compatibility issues which may have cropped up. I'm not a linux desktop power user, and didn't need to be. > I'm not a gamer so I can't tell the difference between 30fps 60 fps etc It's like driving a car with a rough idle vs. a smooth idle. You can get used to driving a car with a rough idle, and not particularly care. But once you've driven both, you can identify which is which pretty easily, and the rough idle starts to bug you when you know it can be smoother.
- Wowfunhappy 7y agoI might make a different comparison: Everyone who has played more than one video game knows that some just feel better than others. In one, your character is fluid and nimble, and in another, slow and clunky. This is the result of many things, but a large portion comes from input lag and frame rate. More advanced users aren't necessarily more perceptive, they're just better at pinpointing what they're reacting to. (And in some cases, conscious of how an experience could be improved.) This is similar to the study of any type of art. Whereas a casual observer might look at a painting and say "meh, I don't like it", someone who has studied art pedagogically can describe precisely what isn't working for them.
- atq2119 7y agoOriginally discussed here: https://news.ycombinator.com/item?id=21959692 https://news.ycombinator.com/item?id=21959692
- brenden2 7y agoStadia is just a bad idea and a bad product. Consumer internet access is nowhere near capable enough for it to make sense.
- swarnie_ 7y agoStadia requirements: 35 megabits per second: 4K, 60 fps, HDR, 5.1 surround sound. Consumer internet is fine for this in a lot of the developed world.
- crashtec 7y agoyoud be suprised how alot of people in developed world don't even have access to this
- jessant 7y agoSurprise me, how many people in the developed world don't even have access to this?
- Supermancho 7y agoMost of the seattle area. Anywhere there is only comcast, or frontier or non ATT Uverse fiber in orange county (Orange, Santa Ana, Anaheim, etc. im sure most of irvine is there). I have doubts about shared google fiber in high density housing as well. 35 MB is a big number.
- izacus 7y agoSo it's not a good product for one US area. What's your exact point? Product doesn't have to cater to every single place on earth to be viable. It's like arguing that ARPAnet was a terrible product because not everyone had T1 lines.
- shadowgovt 7y agoFWIW, Seattle's always been behind the curve. I don't know why, but even in the AOL days they were bad relative to the mid-sized east coast town I grew up in.
- cryptonector 7y agoLinus is right. Don't use spinlocks in user-land. The scheduler can't know you're spinning on a lock, so it can't help you. Don't do dumb things -- spinning on a lock in user-land is dumb. Mutexes are as fast as spinlocks in the uncontended case, so use mutexes.
- shadowgovt 7y agoLinus is right (for the kinds of code Linus tends to think about). There are good reasons videogame engines tend to use spinlocks, and if the takeaway is "Linux pessimizes for that use case," the implication is "Linux pessimizes for high-performance games atop its kernel."
- raverbashing 7y ago> "Linux pessimizes for high-performance games atop its kernel." Yes, because that's not the main focus of a general-purpose kernel. Which doesn't mean there aren't ways around it if your objective is running Linux for a specific application. The real time patches are in the mainline kernel since some time ago, but there are other options for softer RT at the kernel as well.
- quotemstr 7y agoNo, there are not good reasons to use spinlocks in userland. Period. Even in a game. You always have the spinning while preempted problem. You can't blame a preempting operating system for preempting! Any situation you rig up where you don't preempt is very fragile. What you can do is make mutexes perfectly adaptive so that they switch to a blocking wait as soon as the lock owner itself gets preempted. I have a proposal to do that here: https://lore.kernel.org/lkml/CAKOZuesa338sc_=w6-wvro25idrSN_zx_zrHFyo-bDiORs7FZw@mail.gmail.com/ https://lore.kernel.org/lkml/CAKOZuesa338sc_=w6-wvro25idrSN_... You should always use waiting primitives when possible instead of just spinning. If you tell the kernel what you're doing, the kernel can help you. If you hide the wait DAG from the kernel, it can't.
- shadowgovt 7y ago
- sschueller 7y ago"do not use xxx, unless you actually know what you're doing. And be aware that the likelihood that you know what you are doing is basically nil." I got to use that quote at some point. Pure gold.
- rooam-dev 7y agoImho the 2nd part applies to those that use the quote too.
- TomMarius 7y agoIs understanding required to understand that you do not understand for objective reasons?
- metalliqaz 7y agoif you read Linus' post, he says as much immediately after. He says he includes himself in that "you", and notes that the kernel is a result of decades of development by many people working to fix issues that pop up implementing the hard stuff.
- axlee 7y ago> I got to use that quote at some point. Pure gold. If you are not Linus, you might come off as a major asshat. Careful.
- ddalex 7y agoYou might come off as a major ass hat even if you're Linus, but who cares in that case?
- sschueller 7y agoI thought more of something to print on a t-shirt :)
- deleted 7y ago[deleted]
- CoolGuySteve 7y agoI think the more interesting question here is why don't Stadia games use isocpu and sched_setaffinity to ensure their games have the best CPU cache performance and lowest latencies possible. They control the whole box, it should be more like a console than a regular PC.
- oliwarner 7y agoI'd guess they stack more than one game instance on a single server. The instances need to play fair for resources.
- angry_octet 7y agoThere are fairly standard real time scheduling techniques to give whatever time slice you want to each process. Usually you architect it to have a small hard real time and another process for soft real time (e.g. paging data) and you use a priority queue for world updates (intersection tests, gun/missile flyout, updating other player positions). The update thread gets a minimum time quantum and then yields, round robin sharing.
- deith 7y agoAre userland spinlocks the reason most games use 100% of one or several cores even when they are minimised and doing nothing?
- magicalhippo 7y agoKinda. Normal Windows applications use a system call to wait for new messages to arrive, and then react to those. This is very similar to waiting for a mutex, and it allows the kernel to put the thread to sleep until a message comes along. Games often integrates the message loop into their game loop. In their loop, they poll to see if any new message has arrived, and if so handles it. In any case it does it's game thing. If there's not much to do, because the game is paused when it's minimized for example, this spins much like a spinlock spins. If, in addition, it has some other threads it's synchronizing using spinlocks then yes, it can cause it to burn several cores worth doing nothing. Better games handles the loop differently while the game is minimized, for example doing the default wait-for-message variant.
- littlestymaar 7y agoThe original comment from Linus is much more insightful than the “its's complete garbage” quote that was picked for the article: https://www.realworldtech.com/forum/?threadid=189711&curpostid=189723 https://www.realworldtech.com/forum/?threadid=189711&curpost...
- 0xff00ffee 7y agoMy knowledge of linux scheduling has gone up 10x thanks to this debate!
- trishankdatadog 7y agoBTW, Stadia is incredible, but the lack of high-quality big-name games is disappointing...
- haydn3 7y agoWhat Linus is really saying is that the way Skarupke measured the spinlock being 'bad' is wrong. Skarupke tried to measure it in C, but you can never be sure if you're not being scheduled by anything else. Skarupke inaccurately defined this as 'mutex vs. spinlock' and an ongoing debate surrounding this as they are comparable, when in no way are they comparable as in userland you simply cannot use spinlocks. The Windows scheduler apparently doesn't do this, and handles spinlocks better; whatever that means. But the way it works is that spinlocks should work poorly if you run them poorly. Full manual-control of when running a spinlock in userland, you will be scheduled by other things, and you should know that. That's what Linux is really about. The ability to do something and not have the system "better-ize" it like Windows does by doing some black magic and running an unknown process alongside your spinlock to make it run better. A spinlock run in userland SHOULD be scheduled by other things, as Linus says. As Linus implemented in the kernel.