Thread Director: Windows 11 Does It Best

Every operating system runs what is called a scheduler – a low-level program that dictates where workloads should be on the processor depending on factors like performance, thermals, and priority. A naïve scheduler that only has to deal with a single core or a homogenous design has it pretty easy, managing only power and thermals. Since those single core days though, schedulers have grown more complex.

One of the first issues that schedulers faced in monolithic silicon designs was multi-threading, whereby a core could run more than one thread simultaneously. We usually consider that running two threads on a core usually improves performance, but it is not a linear relationship. One thread on a core might be running at 100%, but two threads on a single core, while overall throughput might increase to 140%, it might mean that each thread is only running at 70%. As a result, schedulers had to distinguish between threads and hyperthreads, prioritizing new software to execute on a new core before filling up the hyperthreads. If there is software that doesn’t need all the performance and is happy to be background-related, then if the scheduler knows enough about the workload, it might put it on a hyperthread. This is, at a simple level, what Windows 10 does today.

This way of doing things maximizes performance, but could have a negative effect on efficiency, as ‘waking up’ a core to run a workload on it may incur extra static power costs. Going beyond that, this simple view assumes each core and thread has the same performance and efficiency profile. When we move to a hybrid system, that is no longer the case.

Alder Lake has two sets of cores (P-cores and E-cores), but it actually has three levels of performance and efficiency: P-cores, E-Cores, and hyperthreads on P-cores. In order to ensure that the cores are used to their maximum, Intel had to work with Microsoft to implement a new hybrid-aware scheduler, and this one interacts with an on-board microcontroller on the CPU for more information about what is actually going on.

The microcontroller on the CPU is what we call Intel Thread Director. It has a full scope view of the whole processor – what is running where, what instructions are running, and what appears to be the most important. It monitors the instructions at the nanosecond level, and communicates with the OS on the microsecond level. It takes into account thermals, power settings, and identifies which threads can be promoted to higher performance modes, or those that can be bumped if something higher priority comes along. It can also adjust recommendations based on frequency, power, thermals, and additional sensory data not immediately available to the scheduler at that resolution. All of that gets fed to the operating system.

The scheduler is Microsoft’s part of the arrangement, and as it lives in software, it’s the one that ultimately makes the decisions. The scheduler takes all of the information from Thread Director, constantly, as a guide. So if a user comes in with a more important workload, Thread Director tells the scheduler which cores are free, or which threads to demote. The scheduler can override the Thread Director, especially if the user has a specific request, such as making background tasks a higher priority.

What makes Windows 11 better than Windows 10 in this regard is that Windows 10 focuses more on the power of certain cores, whereas Windows 11 expands that to efficiency as well. While Windows 10 considers the E-cores as lower performance than P-cores, it doesn’t know how well each core does at a given frequency with a workload, whereas Windows 11 does. Combine that with an instruction prioritization model, and Intel states that under Windows 11, users should expect a lot better consistency in performance when it comes to hybrid CPU designs.

Under the hood, Thread Director is running a pre-trained algorithm based on millions of hours of data gathered during the development of the feature. It identifies the effective IPC of a given workflow, and applies that to the performance/efficiency metrics of each core variation. If there’s an obvious potential for better IPC or better efficiency, then it suggests the thread is moved. Workloads are broadly split into four classes:

  • Class 3: Bottleneck is not in the compute, e.g. IO or busy loops that don’t scale
  • Class 0: Most Applications
  • Class 1: Workloads using AVX/AVX2 instructions
  • Class 2: Workloads using AVX-VNNI instructions

Anything in Class 3 is recommended for E-cores. Anything in Class 1 or 2 is recommended for P cores, with Class 2 having higher priority. Everything else fits in Class 0, with frequency adjustments to optimize for IPC and efficiency if placed on the P-cores. The OS may force any class of workload onto any core, depending on the user.

There was some confusion in the press briefing as to whether Thread Director can ‘learn’ during operation, and how long it would take – to be clear, Thread Director doesn’t learn, it already knows from the pre-trained algorithm. It analyzes the instruction flow coming into a core, identifies the class as listed above, calculates where it is best placed (which takes microseconds), and communicates that to the OS. I think the confusion came with the difference in the words ‘learning’ and ‘analyzing’. In this case, it’s ‘learning’ what the instruction mix to apply to the algorithm, but the algorithm itself isn’t updated in the way that it is ‘learning’ and adjusting the classes. Ultimately even if you wanted to make the algorithm self-learn your workflow, the algorithm can’t actually see which thread relates to which program or utility – that’s something on the operating system level, and down to Microsoft. Ultimately, Thread Director could suggest a series of things, and the operating system can choose to ignore them all. That’s unlikely to happen in normal operation though.

One of the situations where this might rear its head is to do with in-focus operation. As showcased by Intel, the default behavior of Windows changes depending on whether on the power plan.

When a user is on the balanced power plan, Microsoft will move any software or window that is in focus (i.e. selected) onto the P-cores. Conversely, if you click away from one window to another, the thread for that first window will move to an E-core, and the new window now gets P-core priority. This makes perfect sense for the user that has a million windows and tabs open, and doesn’t want them taking immediate performance away.

However, this way of doing things might be a bit of a concern, or at least it is for me. The demonstration that Intel performed was where a user was exporting video content in one application, and then moved to another to do image processing. When the user moved to the image processing application, the video editing threads were moved to the E-cores, allowing the image editor to use the P-cores as needed.

Now usually when I’m dealing with video exports, it’s the video throughput that is my limiting factor. I need the video to complete, regardless of what I’m doing in the interim. By defocusing the video export window, it now moves to the slower E-cores. If I want to keep it on the P-cores in this mode, I have to keep the window in focus and not do anything else. The way that this is described also means that if you use any software that’s fronted by a GUI, but spawns a background process to do the actual work, unless the background process gets focus (which it can never do in normal operation), then it will stay on the E-cores.

In my mind, this is a bad oversight. I was told that this is explicitly Microsoft’s choice on how to do things.

The solution, in my mind, is for some sort of software to exist where a user can highlight programs to the OS that they want to keep on the high-performance track. Intel technically made something similar when it first introduced Turbo Max 3.0, however it was unclear if this was something that had to come from Intel or from Microsoft to work properly. I assume the latter, given the OS has ultimate control here.

I was however told that if the user changes the Windows Power Plan to high-performance, this behavior stops. In my mind this isn’t a proper fix, but it means that we might see some users/reviews of the hardware with lower performance if the workload doing the work is background, and the reviewer is using the default Balanced Power Plan as installed. If the same policy is going to apply to Laptops, that’s a bigger issue.

Cache and Hybrid Designs DDR5: Detailed Support, XMP, Memory Boost
Comments Locked

395 Comments

View All Comments

  • romrunning - Wednesday, October 27, 2021 - link

    I think the universal recommendation will be to use the "High Performance" power plan on all desktops. Then you don't have to worry about the threads being shifted onto E-cores if you really needed it on a P-core.
  • PEJUman - Wednesday, October 27, 2021 - link

    I agree this is easy, but that's not the point.

    What I am saying is how much longer will you tolerate this kind of quality? why should I fiddle with power profiles to patch a broken/nonQA'd scheduler. Microsoft does not pay me for beta testing their scheduler, they also failed to pay me to beta testing their thunderbolt 3 and 4 implementations. And to make this worse, This is a product that MS actually sells and tries to make money from.

    I do not have to do any of these with on the macbook Air. And the macOS is freaking free, it's licensed to their hardware set.

    FYI here is what I currently running, just in case you're wondering:
    Desktop: 5950x + 3090 @ 8K on HDMI 2.1 Homebrew
    Laptops: Dell Inspiron 1165g7, XPS 1065g7, HP Zbook workstation with i7 6th gen. All of these crashes repeatedly with TB3 and TB4 docks from Dell/HP/OWC. And guess what, the fix is not to let the laptop sleep (sounds familiar?).

    Apple: phones, ipads, macbook air with 8th gen i5 + TB3 dock.

    These apple products have much higher uptime, almost 20x better than the MS products above. My desktop is by far the most stable, but still a long shot away from the mac. Looking at this article, I expect W11 with Adler lake laptops to go even worse. Intel, AMD and MS need much tighter integration and QA to compete with M1s from Apple. Microsoft, Intel and AMD, if you are reading this. Next year, I am betting that my money will be spent towards a M2 & MacOS powered laptop. Please prove me wrong.
  • Robberbaron12 - Wednesday, October 27, 2021 - link

    The Thunderbolt 3 and 4 Implementation on Windows 10 has been one giant Charlie Foxtrot. We have had endless issues with Dell and HP laptops and desktops with terrible TB software and drivers crashing continuously. M$ and the OEMs blame each other and nothing improves (I'm actually pretty sure its Intels firmware) but Apple can make it work so ????
  • Spunjji - Thursday, October 28, 2021 - link

    Intel and MS are the two consistent factors on the PC side. Could be MS, could just be Intel writing lousy drivers. Hard to say.
  • Dug - Wednesday, October 27, 2021 - link

    The Macbook Air M1 release was a clusterf. Memory management was hosed creating GB's of writes a day to ssd. TB docks did not work and caused kernel panic. External monitor support was non existent, meaning you couldn't control resolution or refresh rate on most popular monitors. I know because I lived through the beta testing and release. So don't go thinking Mac is all grandiose all the time.
  • PEJUman - Wednesday, October 27, 2021 - link

    Is this still a problem today? Will it be fixed by the time M1max/pro hits meaningful quantities in the wild?
  • Spunjji - Thursday, October 28, 2021 - link

    Fixed, AFAIK
  • Oxford Guy - Thursday, October 28, 2021 - link

    The shattering screen hasn't been fixed.
  • name99 - Thursday, October 28, 2021 - link

    "Memory management was hosed creating GB's of writes a day to ssd."

    And yet the only people who ever cared about this were people who insisted it meant early death of the SSDs and were looking for something to be wrong with the machines.
    I am unaware of a single case where this had any real-world effect, and as far as we know, it may well have been bugs in the SW that was reporting these numbers.

    "I know because I lived through the beta testing and release."
    What do you expect from beta testing?
    If you'd stuck to "I know because I lived through the initial release", and dropped the stupid "OMG my SSD will be dead in three months" hysteria, you'd be a lot more convincing. As it is, you come across as the sort of person who insists on finding things to complain about, and if you can't find something reasonable, you'll find something unreasonable.
  • Oxford Guy - Thursday, October 28, 2021 - link

    Apple has yet to fix the CD player bug I reported back in 2001.

    The original Mac OS (last released as OS 9) played audio discs at 1x. OS X has always spun the discs at the maximum read speed of the drive, which is utter incompetence.

    I just checked and Catalina is still doing it.

    I reported the bug via Apple's OS X report page at least twice, probably four times — over the years. That a $1 trillion company can't manage to get audio CDs to play at the correct speed in decades is beyond appalling.

Log in

Don't have an account? Sign up now