TITLE: [MUSIC]
MONICA GUPTA: Hello.
My name is Monica Gupta.
I'm a Technical Leader at Intel,
working in a team whose mission is
to ensure Intel architecture
works best on Windows and
Windows runs best on Intel architecture.
As part of my role,
I get immense pleasure of
collaborating with our great partners, Microsoft.
Nothing is constant in my job.
Hardware keeps evolving,
software keeps changing,
and to ensure that they both work in unison,
they both work best together,
we have to keep innovating.
It is really gratifying to see
the benefits of all the work my team,
myself, in deep collaboration with Microsoft,
have achieved over the years.
Today, we are going to focus
on Alderlake's new hybrid architecture,
Windows enabling that was done to
maximize the usage of this new architecture,
and what are the key practices software ecosystem
could leverage to take
the benefit of this new technology.
Hybrid architecture integrated
two core families; P-cores and E-cores.
P-cores are optimized for performance and E-cores,
while they provide reasonable performance,
they are highly optimized to provide
an efficient system.
Some workloads really need the performance of P-cores.
For example, you're playing a game
or doing some AI operations.
But some applications scaled
really well with the addition of E-cores.
Did you know Intel could add
four E-cores in approximately the same area
as one E-core?
Providing us with a really efficient system.
Processor capabilities are dynamic in nature.
Intel's hybrid technology
provides processors' performance and
efficiency capability to Windows and notifies
Windows whenever there's
a meaningful change in these capabilities.
This technology is also
available and works well with Windows 10.
Intel's Thread Director technology
analyzes thread behavior in terms of instructions
that the thread is executing and
provides all thread performance
and efficiency classification
back to Windows in order for
Windows to identify the threads that
could really gain maximum performance
from P-cores versus E-cores.
Windows with its inherent and evolving information
about software thread needs and
system goals is in
an amazing position to
place the right thread on the right core.
Let's look at some examples to understand this further.
The thread detector technology classifies threads
into different performance and efficiency classes.
On this example, you can see there are a number
of threads in different classes that are ready to run.
Say there is no contention
for those P-cores or performant
cores and as threads are demand oriented,
Windows would place those threads
on the P-cores or the most performant cores.
Now let's say the contention
between the performant core increases.
In this situation, Windows would move
those class 3 threads from P-cores to E-cores,
or it would schedule them on E-cores based
on the way the threads came in.
If a class 3 thread came in later,
it would be scheduled on the E-core.
How did it decide to move that class 3 thread to E-core?
That is based off Intel's Thread Director technology,
which classifies that class
3 thread might not be able to gain
as much performance from
P-core versus E-cores compared
to other class of threads.
Over time, if the processor capabilities change and if
a particular class thread could gain
more performance from E-core versus P-core,
then Thread Director would
enumerate that information back to
Windows and Windows would move
that class thread on the E-cores.
Foreground and background is only one of
the characteristics that influences
quality of service needs of different threads.
Let's now deep dive into what are
the various characteristics that could
influence these cores level of a thread.
What better than to hear from an expert.
Today, I had the honor of inviting
Tristan Brown to walk us through what are
the various quality of
service levels of a thread and what are
the various OS APIs
that application developers could leverage?
What are the various frameworks
that software ecosystem could
leverage to better influence
this identification in Windows?
I've been working with Tristan for
over eight years now on different innovation
and enabling to bring about
Intel and Windows processor
file management technologies to life.
Here you go, Tristan
TRISTAN BROWN: Thanks, Monica. My team
has been working with Intel for over four years,
developing Windows support for
the Intel hybrid architecture,
and I'm excited to share
a few tips on how developers can make
their software work better with Windows 11 on Alderlake.
Windows categorizes process and threads based on
user experience expectations
into different [inaudible] levels.
The foreground application the user is
interacting with runs at the highest quality of
service and hidden or minimized
applications run at a reduced quality of service.
For system services and kernel threads,
Windows users work on [inaudible] relationships,
such as RPC calls and other heuristics,
to infer the quality of service requirements
for individual threads and to make
sure threads contributing to
the end-user experience are categorized appropriately.
Quality of service, hence,
have been used by Windows to control
performance and efficiency tradeoffs on
threads for several processor generations.
On Alderlake systems,
Windows uses both quality of service
and Thread Director to additionally
determine which threads should be
prioritized on P-cores to maximize
end-user benefit and which threads can be
run efficiently on E-cores without impact.
Applications can help Windows make informed decisions
by opting-in or out of PowerThrottling.
Opting-in to PowerThrottling provides a hint that
your application is performing
work that is not performant
sensitive and Windows [inaudible] can
work efficiently to leave more headroom for
higher quality of service work
or to improve battery life.
Applications running background maintenance tasks
are good candidates for opting-in to PowerThrottling.
For example, content indexing tools,
online backup, background software updaters.
Applications can also opt individual threads into
PowerThrottling if they have background work
running in the same process as their user interface.
Threads which contribute to user awareness,
such as UI threads or
real-time virus scanner threads are
not good candidates for opting into PowerThrottling.
Applications can opt out of
PowerThrottling to run
at a higher quality of service level.
Application should use
the PowerThrottling opt-out sparingly,
as doing so will have a battery life impact and can take
power budget away from
other applications the user is interacting with.
Windows is generally cautious about
assigning reduced quality of service,
and most applications should not need to opt-out.
Note that opting into or out
of PowerThrottling will not always make
your application run on an E or P-core.
Windows will take additional
considerations into account,
including whether or not the system is running on
battery and Thread Director hints
to decide which type of core will be most
performant or efficient for an individual thread.
Opting-in or out of PowerThrottling is simple with
the set process information and
set thread information APIs.
Set the control bit for execution speed to
indicate the application wants
to control PowerThrottling,
setting the state that opts-in
and clearing the state that opts-out.
Clearing the control bit will
return control back to Windows.
Note that while opting into
execution speed throttling may reduce
CPU performance while your work is
running, that isn't guaranteed.
Windows does not use
a one-size-fits-all approach to
manage quality of service expectations.
On a thin and light laptop running on battery power,
Windows will likely limit
execution speed of power throttle threads.
On a desktop workstation,
PowerThrottling may only be
used to help prioritize which threads
get P-cores when the system is heavily
loaded with more active threads than P-cores.
Microsoft and Intel work closely with
each other and our OEM partners to tune
the scheduler and power manager's behavior for
different types of systems
under different operating conditions.
End users can also influence this behavior by
configuring the system's power mode in the settings app.
By opting in to PowerThrottling, applications can better
tailor the behavior to the end user's preferences.
Windows provides APIs for applications and
drivers to directly control thread affinity.
These APIs should be avoided where possible.
If an application wants its threads to
run most performant or efficient,
it should instead use the PowerThrottling hints to
bias execution towards P or E cores.
Note again, Windows and
Thread Director will work together to
determine which core will be the most
performant or efficient for an individual thread.
Your application won't always get the best results by
directly setting thread affinity to P or E cores.
If an application needs to guarantee two threads run on
the same processor or
two threads run on two different processors,
it can use the CPUSets APIs to do so.
These APIs are designed to work
better with heterogeneous scheduling.
The CPUSets API allows
applications to enumerate distinct CPU sets,
and associate a process or
thread with one or more CPU sets.
Get system CPU set
information with all the CPU sets on the system,
including a variety of characteristics applications
can use to determine the properties of each CPU set.
Set thread selected CPU sets
indicates which CPU sets
an individual thread should run on,
and set process default CPU sets indicates
which CPU set should be used for
threads without explicit configuration.
In this example, the process is
using two CPU sets to isolate
all other threads in the process from
running on the same core as the current thread.
Applications should use the CPUSets API
only when necessary to give
the scheduler the most flexibility in determining
which threads are allowed to run on each core type.
Windows built in multimedia APIs,
such as Media Foundation provide additional quality of
service hints to improve
efficiency and performance on hybrid platforms.
Media playback workloads understand
their deadlines, for example,
for decoding a frame of video and can
batch decode multiple frames of video ahead of time.
Windows uses this information to
schedule batch workloads on E-cores,
prioritizing efficiency to increase battery life
and to keep power budget available
for other application threads.
Normally slow and steady is more
than enough to complete media work in time,
but in the rare case
a deadline is close to being missed,
Windows will automatically raise quality of
service for that task and boost up to
high performance on a P-core preventing the user
from observing a dropped frame or audio glitch.
To take advantage of this advanced scheduling,
applications should make use of Windows
built-in frameworks and controls for media playback,
such as Media Foundation or the
Windows.Media Namespace for UWP apps.
While most of these tips apply
to application developers,
driver authors also play a part in ensuring that
users get the best experience on hybrid platforms.
Driver should avoid the use of affinity
for threads and DPCs.
Drivers can also opt their threads in and out of
PowerThrottling by using the ZwSetInformationThread API.
Drivers without preprocessor queue should also
configure IRQ policy to
work well with Interrupt Steering.
Interrupt Steering configures driver interrupts based on
overall system demand to either spread out
across multiple cores or consolidate
down to fewer cores.
Interrupt Steering works hand in hand with
the scheduler to make sure that cores
processing interrupts are also able to
run threads readied by those interrupts.
If your driver configures
interrupts to run on a specific core
and Windows and Thread Director have decided
not to use that core for the current workload,
this can lead to both performance
and efficiency degradation.
Performance degradation due to the latency of waking up
a second core to run
a thread resulting from that interrupt,
and efficiency degradation due to
the fact that two cores need to be woken
up while servicing the interrupt instead of just one.
Configuring your driver to work
well with Interrupt Steering is as
simple as leaving IRQ policy set to machine default.
This is the default configuration for
both WDF and WDM drivers,
so driver authors don't need to do anything
extra to get the benefits of Interrupt Steering.
These best practices will help
your applications get the most out
of Windows 11 on Alderlake.
They're also beneficial in systems running
Windows 10 and on systems using homogeneous processors,
so you should incorporate them in
your application regardless of which version
of Windows or which
processor your application is running on.
Back to you, Monica.
MONICA GUPTA: Thank you, Tristan.
This is really
exciting and it is great to learn
how Windows identifies quality of
service needs of different threads,
and provides powerful tools
like PowerThrottling APIs and
Windows Media Framework for
software ecosystem to influence that identification.
How avoiding affinity and leveraging
the default Interrupt Steering policy can
ensure applications and drivers can take
maximum advantage of
the inbuilt smart scheduling and Interrupt Steering.
We look forward to seeing
software ecosystem leveraging these tips on
hybrid system to unleash
the full potential of Windows 11 OS,
and Intel's new Thread Director technology. Thank you.