Originally posted by coder
View Post
Announcement
Collapse
No announcement yet.
FUTEX2 Spun Up A Fifth Time For This Linux Interface To Help Windows Games
Collapse
X
-
- Likes 3
-
Originally posted by F.Ultra View PostCould also be argued that in an environment where you do have access to WFMO then people tend to design their code around it leading to IMHO an abundant usage of multiple object when fewer might have served the same purpose. Looking that the situations that WINE is trying to solve here with games creating, waiting for and disposing millions of such objects then IMHO this scream inefficient design (of the games, not of WFMO).
Originally posted by F.Ultra View PostWhat major optimizations for games have WIndows done (ignoring DIrectX since that is a special case)? I have to admit that I'm a bit rusty coding for Windows now a days but I cannot think of anything major changed in this regard the last decades?!
Here is what I know offhand, not excluding DirectX, as it is a large collection of APIs and the list becomes really short without it:
* SRW Locks
* Miscellaneous scheduler improvements
* DXIL's elimination of libraries/modules, which allows better shader compiler output via interprocedural optimizations that could not be done between libraries. They seem to have taken a stepbackward by adding experimental library support to DXIL1.1. The elimination of libraries is basically copied from Vulkan (or was it Mantle?).
* Supporting the latest initiatives by GPU designers such as Resizable BAR Support, Mesh Shading, Variable Rate Shading, Sampler Feedback, etcetera.
* Not forcing NVMe to use a queue depth of 1 like their initial NVMe support did.
It is not a very impressive list, although it is not comprehensive either. It is just a bunch of miscellaneous things. I am not sure if some of them count as major things.Last edited by ryao; 10 July 2021, 10:30 AM.
- Likes 2
Comment
-
Originally posted by F.Ultra View Post
What major optimizations for games have WIndows done (ignoring DIrectX since that is a special case)? I have to admit that I'm a bit rusty coding for Windows now a days but I cannot think of anything major changed in this regard the last decades?!
Comment
-
Originally posted by F.Ultra View PostWhat major optimizations for games have WIndows done (ignoring DIrectX since that is a special case)?
I'm sure there are tons of other things Windows did to optimize for games. The main question I have is which of them were bad for security or other types of apps? There was that whole thing people ran into porting games to Stadia with userspace spinlocks that didn't work so well, in Linux -- how much did Windows have to gimp their scheduling code to make crap like that work well?
Comment
-
-
Originally posted by coder View PostI'm no Windows expert, but I'd say pulling GPU drivers into userspace (or, at least out of ring 0) was a pretty big one.
Originally posted by coder View PostI'm sure there are tons of other things Windows did to optimize for games. The main question I have is which of them were bad for security or other types of apps? There was that whole thing people ran into porting games to Stadia with userspace spinlocks that didn't work so well, in Linux -- how much did Windows have to gimp their scheduling code to make crap like that work well?
Windows games codes for multi core seems to include a lot of sleep(0) and SwitchToThread() which reminds me of how we used to code back in the 8-bit days with NOP:s at certain places to time things exactly to the correct scan line.
edit: and to answer your "how much did Windows have to gimp their scheduling code to make crap like that work well?" well to make sched_yield() work the way that Windows dev expected it to behave the Windows scheduler needs to have a single run-queue for the whole system and have sched_yield() put the current thread at the back of the queue and switch scheduling to the thread at the front of the queue.Last edited by F.Ultra; 11 July 2021, 09:39 AM.
Comment
-
Originally posted by F.Ultra View PostHow did that improve games? AFAIK they put it in ring 0 for performance reasons back in the day and only decided to move it to userspace in Vista as to not have the whole system go down with the drivers,
Originally posted by F.Ultra View PostI don't think that Microsoft had games in mind when they decided on how their scheduler should behave
Comment
-
Originally posted by coder View PostI'm sure it did. Maybe not initially, but certainly guiding how it evolved over the years. Gaming was very high-profile, in Microsoft, since Windows 95. Aside from server loads, it's been one of the main stress cases for Windows and foremost of the applications continually pushing it forward.
Comment
-
Originally posted by coder View PostThere was that whole thing people ran into porting games to Stadia with userspace spinlocks that didn't work so well, in Linux -- how much did Windows have to gimp their scheduling code to make crap like that work well?
The performance of a variety of spinlocks varied on Linux vs WIndows. Depending, there were results on Linux that were better, almost equal, and worse.
The two locks which had the best average performance ("std::mutex" and "spinlock") actually had much better latencies on Linux.
The one spinlock that did much worse on Linux was the initial badly designed "terrible_spinlock" that also had exceptionally bad results on WIndows. In that sense it was an outlier that shouldn't exist in the first place. (The one that used neither pause nor yield.) (BTW, none of the spinlocks had a really good so-called back off algorithm.)
However that blog introduced an additional metric for analysis, which was supposed to find the reason for the intial problem, called "idle times". And that metric was ill-conceived and did not measure what it was meant to measure, but made Linux look bad in spite of not being a meaningful value in the first place. The (worst-case) latencies were already much better measured by the "waits" times.
Originally posted by F.Ultra View Postedit: and to answer your "how much did Windows have to gimp their scheduling code to make crap like that work well?" well to make sched_yield() work the way that Windows dev expected it to behave the Windows scheduler needs to have a single run-queue for the whole system and have sched_yield() put the current thread at the back of the queue and switch scheduling to the thread at the front of the queue.
"spinlock" actually had much better latencies on Linux, whereas "ticket_spinlock" had much better latencies on Windows. (I wonder what the results of a really good benchmark would have been.)
All this got very confused by the dominant treatment of the ficticious "idle times", which made Windows look better than it deserved. However the whole test and especially the lock implementations where not really done by experts, so all of this needs to be taken in context altogether.
Comment
-
Originally posted by indepe View PostIf you are referring to the blog post and benchmarks by "ProbablyDance" that was discussed here a while ago, that was more complicated.
These are actually very informative posts. Here's his first reply. I'd encourage you to read it & the others by him (scroll to the bottom to see the list):
Originally posted by indepe View PostThe performance of a variety of spinlocks varied on Linux vs WIndows. Depending, there were results on Linux that were better, almost equal, and worse.
Comment
Comment