Slashdot Mirror


24 Cores and the Mouse Won't Move: Engineer Diagnoses Windows 10 Bug (wordpress.com)

Longtime Slashdot reader ewhac writes: Bruce Dawson recently posted a deep-dive into an annoyance that Windows 10 was inflicting on him -- namely, every time he built Chrome, his extremely beefy 24-core (48-thread) rig would begin stuttering, with the mouse frequently becoming stuck for a little over one second. This would be unsurprising if all cores were pegged at 100%, but overall CPU usage was barely hitting 50%. So he started digging out the debugging tools and doing performance traces on Windows itself. He eventually discovered that the function NtGdiCloseProcess(), responsible for Windows process exit and teardown, appears to serialize through a single lock, each pass through taking about 200 microseconds each. So if you have a job that creates and destroys a lot of processes very quickly (like building a large application such as Chrome), you're going to get hit in the face with this. Moreover, the problem gets worse the more cores you have. The issue apparently doesn't exist in Windows 7. Microsoft has been informed of the issue and they are allegedly investigating.

8 of 352 comments (clear)

  1. The lock cycles were avg 200 us each by Anonymous Coward · · Score: 5, Informative

    Not 200S each, which is off by a factor of one million. But, hey.

    1. Re:The lock cycles were avg 200 us each by viperidaenz · · Score: 1, Informative

      5 thousandths of a second

  2. Windows has always been unresponsive to user input by fustakrakich · · Score: 5, Informative

    We just don't have priority...

    --
    “He’s not deformed, he’s just drunk!”
  3. Re:I don't get it. by Anonymous Coward · · Score: 4, Informative

    The Windows GUI interface actually uses a separate process to update the mouse on the screen. Due to various historical reasons (compatibility with old applications, mostly), it was required to recycle this process every time the mouse moved, as the process could get a memory leak (which couldn't be fixed properly, in order to preserve compatibility with the aforementioned applications). Therefore, every time the coordinates of the mouse change, the process has to be killed and replaced, therefore putting it through the same lock that this build process is hogging. Combine that with the 200 second delay to get through the lock, and the responsiveness is easily explained.

    It's worth it to keep compatibility with the "After Dark" flying toasters screensaver, though.

  4. Re:Windows... by Rutulian · · Score: 3, Informative

    Again, slow and over-used everything else should not slow the UI and user input processes. This is basic.

    The oversimplified, but short answer is that there is no such thing as a multiprocess CPU. All CPUs can execute on only a single thread per cycle. The kernel exists to allow multiple processes to be resident and to provide the illusion of multiple thread execution. In other words, the essential function of the kernel is scheduling, and in doing this the kernel has to make decisions about process priority that impact responsiveness and resource utilization in often diametrically opposite fashions. To gain responsiveness, a process that is further down the execution queue has to preempt processes further up the queue, delaying their execution. This has a negative impact on overall thread performance as your CPU will be mostly underutilized if there is a lot of preempting going on. If the kernel inhibits (or prohibits) preempting, it can more efficiently utilize your CPU, allowing many threads to get as much CPU time as possible, but this will have a very negative impact on responsiveness.

    UI and user input processes are just processes to the kernel. You can, of course, just give UI and user input processes the highest possible priority at all times, but this is not automatically the best thing to do in every circumstance. For example, you probably don't want your audio stream in the background to stutter or stop playing just because you started moving the mouse. And if you are flushing a file to disk, you probably want that operation to complete atomically, rather than be interrupted by a pop-up dialog, because corrupted filesystems tend to make users pretty unhappy.

  5. Re: Not just when closing a program by viperidaenz · · Score: 4, Informative

    Android is dropping to lower-res/fewer colors to accelerate the transition

    Or did it swap the high-res texture for a low-res one to save memory while it was not in use?

    GPU's have been able to do 32bit acceleration for a long time.

    Semi-OK gaming video cards that didn't support DirectX 9 couldn't run Vista Aero because it used the DirectX 9 API, required hardware based Pixel Shader 2.0 (not emulated in the driver) and at least 128MB of RAM. Not because of bit-depth.

  6. Re:So it's not just me by superwiz · · Score: 3, Informative

    People may ask why I run Windows XP. It's because I have some old software that I like and it won't run on my newer Windows 10 computer.

    It's why people virtualize old PCs now. You run your old PC in a window.

    One of the Windows XP computers claims to have been on for over 15 years.

    32 bits of milliseconds is 49 days. Windows XP is a 32 bit system and a common way to measure how long it's been up is by issuing a system call which returns the number of milliseconds since the system startup.

    --
    Any guest worker system is indistinguishable from indentured servitude.
  7. Re:I don't get it. by mvdwege · · Score: 5, Informative

    Yes, you are making exuses, that's exactly what a tu quoque fallacy is

    The big lock was removed in 2011, Microsoft produced a regression on an already bad design a lot closer in history. That's a sign of incompetence, period.

    Also, the Linux kernel has bad backwards compatibility, which is why things like drivers and such should be upstreamed as much as possible and built in the main tree, but Linux userland still happily runs old Unix software, so you are overstating that case as well.

    --
    "I know I will be modded down for this": where's the option '-1, Asking for it'?