Download presentation
Presentation is loading. Please wait.
Published byIskander Karadeniz Modified over 5 years ago
1
Pedro Miguel Teixeira Senior Software Developer Microsoft Corporation
1/15/2019 6:44 AM SVR18 Developing Applications for Scale-Up Servers Running Windows Server 2008 R2 Pedro Miguel Teixeira Senior Software Developer Microsoft Corporation © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
2
Agenda Developing Applications for Scale-Up
1/15/2019 6:44 AM Agenda Developing Applications for Scale-Up Processes and Threads in systems with more than 64 Logical Processors* Processor Groups and CPU distribution Processes and Threads System Topology New and revised APIs User Mode Scheduling Writing a User-Mode Scheduler User Mode Scheduler API © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
3
Processor Groups for Scale Up
1/15/2019 6:44 AM Processor Groups for Scale Up Segmented specification – “groups” of CPUs Windows 7/R2 Supports more than 64 Logical Processors CPUs identified in software by Group#: CPU# Allows backward compatibility with 64-bit affinity New applications have full CPU range using new APIs © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
4
Processor Group Assignment
Maximum 64 LPs per Group Minimum possible that fits all LPs Currently a Maximum of 4 LPs distributed by proximity: All LPs (e.g., hyper-threads) in a Core; All Cores in a Socket; Closer Sockets*; NUMA Nodes**; Closer NUMA Nodes;
5
Processor Groups Example: 4 LPs/core, 4 cores/socket, 2 sockets/node, 4 nodes: 128 LPs Group NUMA Node Socket Core LP Group NUMA Node Socket Core LP
6
Processes and Threads Each Thread can only be in one Group
Threads can be assigned to Groups: CreateRemoteThreadEx SetThreadGroupAffinity Processes are assigned to Groups in Round Robin* By default: Threads inherit the Group from the Parent Thread First thread inherits the Group from its Process
7
System Topology Processor topology exposed Memory topology exposed
Groups NUMA nodes Sockets Cores Logical Processors (e.g., hyper-threads) Includes details of CPU caches (L0/L1/L2) Memory topology exposed Device location exposed (e.g., network and storage controllers)
8
New APIs GetActiveProcessorCount GetActiveProcessorGroupCount
GetMaximumProcessorCount GetMaximumProcessorGroupCount GetProcessGroupAffinity GetProcessorSystemCycleTime GetThreadGroupAffinity SetThreadGroupAffinity GetNumaNodeNumberFromHandle
9
Revised APIs CreateRemoteThreadEx GetCurrentProcessorNumberEx
GetLogicalProcessorInformationEx GetNumaAvailableMemoryNodeEx GetNumaProcessorNodeEx GetNumaProximityNodeEx GetNumaNodeProcessorMaskEx GetThreadIdealProcessorEx SetThreadIdealProcessorEx QueryIdleProcessorCycleTimeEx
10
User Mode Scheduling (UMS)
Provide a comprehensive infrastructure for Applications to implement their own thread scheduling Support both Kernel and User synchronization events* Maximize CPU time spend executing application’s work Complete Win32 compatibility* UMS solves thread state problem by separating user-mode thread and kernel-mode thread
11
Cooperative Scheduling
Avoiding lock contention gives the best scaling Cooperative scheduling in user-mode avoids contention and context switches Non-running threads User Thread 3 User Thread 4 User Thread 5 User Thread 6 Core 1 Core 1 Core 2 Core 2 User Thread 1 Thread 1 User Thread 2 Thread 2 Thread 3 Thread 4 Thread 5 Thread 6 Kernel Thread 1 Kernel Thread 2 Kernel Thread 3 Kernel Thread 4 Kernel Thread 5 Kernel Thread 6 Thread Scheduling
12
User Mode Scheduling Reason: Yield Reason: Yield Reason: Blocked
Scheduler’s Ready List Wait Reason: Yield Reason: Yield Reason: Blocked Reason: Created Core 1 Core 2 UMS completion list W1 W2 W3 W4 S1 S2 User Kernel Scheduler Threads Blocked Worker Threads
13
UMS API CreateUmsCompletionList DeleteUmsCompletionList
GetUmsCompletionListEvent DequeueUmsCompletionListItems GetNextUmsListItem CreateUmsThreadContext DeleteUmsThreadContext EnterUmsSchedulingMode ExecuteUmsThread UmsThreadYield GetCurrentUmsThread QueryUmsThreadInformation SetUmsThreadInformation
14
Scheduler writing No locks should be shared between Scheduler Threads and Worker Threads Adds complexity to writing user-mode synchronization objects/primitives Includes not only application locks but also OS implicit (and maybe internal) locks, reducing the operations that can be performed within the scheduler* Schedulers may need to create auxiliary worker threads for housekeeping tasks
15
YOUR FEEDBACK IS IMPORTANT TO US!
Please fill out session evaluation forms online at MicrosoftPDC.com
16
channel9.msdn.com/learn
1/15/2019 6:44 AM Learn More On Channel 9 Expand your PDC experience through Channel 9 Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers…. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
17
1/15/2019 6:44 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
18
1/15/2019 6:44 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.