Beruflich Dokumente
Kultur Dokumente
Microsoft Corporation
Published: October 2003
Abstract
Microsoft Windows Server™ 2003 enables large x86-based and 64-bit enterprise class multiprocessor systems
to scale very well. This document describes many of the significant kernel scalability improvements in
Windows Server 2003.
Microsoft® Windows Server™ 2003 White Paper
Contents
Contents........................................................................................................................................3
Introduction...................................................................................................................................1
Scheduling.....................................................................................................................................2
Memory Management...................................................................................................................3
Kernel Spinlocks...........................................................................................................................5
Heap...............................................................................................................................................6
Summary........................................................................................................................................8
Related Links.................................................................................................................................9
Microsoft® Windows Server™ 2003 White Paper
Introduction
In Microsoft Windows Server™ 2003, significant work has been completed to improve overall kernel
scalability. Detailed analysis, with both software and hardware tools on systems with up to
32 processors, was used to significantly improve Windows Server 2003 scalability on large x86-based
and 64-bit systems with eight or more processors. A number of different workloads were used to
analyze scalability on Windows Server 2003, such as Transaction Processing Performance Council
TPC-C and SAP Sales and Distribution (SD) workload. This document describes the improvements that
have been made to the following areas:
• Scheduling
• Memory management
• Kernel spinlocks
• Heap
In addition, several other Windows Server 2003 features and components, such as Internet Information
Services (IIS), Active Directory , and various networking components have been improved significantly.
Although these improvements are not specifically outlined in this document, the improvement of the
overall efficiency of the Windows kernel benefits a large number of services and applications.
The scalability improvements in Windows Server 2003 enabled the 64-bit NEC Intel Itanium 2 32way
TX7/i9510 server to achieve 308,620 tpmC using Microsoft SQL Server™ 2000 (64-Bit) and more than
doubled throughput with the Unisys ES7000 32way x86-based Enterprise Server using SQL Server
2000 on the industry standard TPC-C workload. (For more information, see the Transaction Processing
Performance Council Web site at www.tpc.org). Windows Server 2003 dramatically improves scalability
on large enterprise class multiprocessor systems.
Scheduling
Windows Server 2003 contains many enhancements based on analysis, improvement, and verification
of scheduler data structures and code paths. These include:
• Significant reduction in dispatch scheduler spinlock usage.
o Reduction in the average and maximum length of time the lock is held.
o Change in ranking of scheduler and per thread asynchronous procedure call (APC) lock to
reduce time holding scheduler lock.
• Removal of context swap spinlock used for thread context switches and translation lookaside buffer
(TLB) invalidates.
• Improved anti-convoy features to reduce context swap, which can occur when several threads
repeatedly compete to acquire user mode locks.
• Replacement of global wait lists and ready queues with per-processor wait lists and ready queues.
• Improved I/O float count by changing from a shared data count to balanced per-processor counts.
• Improved implementation of SYNCH_LEVEL IRQL spinlocks for x86-based systems (for example, the
scheduling dispatch lock).
Memory Management
Windows Server 2003 provides many scalability improvements to memory management that cover the
following areas:
• Address Windowing Extension (AWE) allows a server or application to quickly map, remap, and unmap
virtual addresses to a very large physical address space. As a result, servers (such as SQL Server 2000)
can access all physical memory (up to 64 GB) on an x86-based system that is limited to two gigabytes (GB)
of virtual address space.
• Disk I/O, when using Direct Memory Access (DMA), requires memory management to lock I/O buffers
into memory while I/O occurs.
• Memory management maps pages into virtual address space on demand. Soft page faults occur when
required data exists in physical memory but not in virtual memory, which might be the result of an
application or memory management unmapping memory to reuse virtual addresses for another purpose.
• Zero pages are used on demand to provide security for data sections and in response to an application
request for data pages. Windows zeros proactively, so the zeroing of a page can be done on demand to
reduce the cost of demand zero fault.
Windows Server 2003 memory management improves scalability by dramatically reducing spinlock
contention. Improvements to memory management include:
• Reduction in page frame spinlock.
o Reduction in the frequency of acquires on many paths, including disk I/O page lock and unlock
and soft page faults.
• Removal of the memory management system space lock for system address mapping.
• Support for user mode large page, available with the VirtualAlloc function but restricted to single
process usage (cannot be shared among processes). In terms of page size, the following are available:
• Removal of AweLock, which improves scalability of AWE page map and unmap operations.
• Bypass of page frame spinlock for disk I/O to AWE and large pages.
o Support increased from 32 GB on Windows 2000 to 64 GB on Windows Server 2003 for x86-
based computers.
• Increased virtual address space on 64-bit versions of the Windows Server 2003 family and, as a result,
dramatically improved overall system capacity. For example:
o More than 10 times the number of network connections can be made on 64-bit systems (more
than 1 million on 64-bit systems versus 100,000 on x86-based systems).
o The number of processes that can be created is increased by more than 22 times on 64-bit
systems (more than 550,000 on 64-bit versus 22,000 on x86-based systems).
In addition, large servers and applications can improve overall performance through the use of flat
memory that does not require frequent virtual or AWE map and unmap operations. For example,
performance and scaling on SQL Server 2000 and SAP is significantly better on 64-bit systems
because of a reduction of map and unmap operations.
• Reductions in IRQL raise and lower operations on all memory management, pool, and AWE mappings.
o At boot, free pages are zeroed in parallel with a thread for each processor, which makes this
process occur much faster on a multiprocessor system.
o Runtime zeroing of AWE and large pages on demand provides faster parallel page zeroing.
o Images always share pages, regardless of frequent rebase collisions. This functionality reduces
the physical memory footprint and commitment while increasing the cache hit ratio.
o Lookaside list usage has been increased for frequent terminal server nonpaged and paged pool
allocations.
• Claims-based working set trimming, which is now used for multiprocessor as well as uniprocessor (UP)
systems. Claims-based working set trimming improves page trimming.
• Change of the virtual address descriptor (VAD) tree to an AVL balanced tree (that is, no longer a splay
binary search tree). The VAD is now bitmapped for fast allocations and elimination of long searches.
Kernel Spinlocks
Spinlocks provide an effective method to synchronize shared kernel data structures. The Windows
kernel uses spinlocks in many places to provide atomic data updates. In Windows 2000, queued
spinlocks were introduced and applied to several global hot locks. Queued spinlocks improve
synchronization of shared data that is heavily used by:
• Implementing first in first out (FIFO) for processors waiting for the spinlock.
• Removing the race condition that occurs when multiple processors are waiting for the spinlock.
• Reducing bus usage (due to removal of the race condition) and providing a per-processor indicator for
the status of the spinlock.
However, queued spinlocks in Windows 2000 are limited to the global static type and require
preallocation of a portion of the queue area for each lock on each processor. Windows Server 2003
provides a new type of queued spinlock called in-stack queued spinlock, which can be used on
nonglobal spinlocks with multiple instances and does not require a preallocation of queue area. In this
case, the queue area used is on the stack, which provides temporal locality. In-stack queued spinlocks
also reduce bus utilization and provide balanced FIFO ordering on Windows Server 2003. The only
restriction on the use of in-stack queued spinlocks is that the activation record that existed when the
lock was acquired must still exist when the lock is released.
Heap
Windows Server 2003 provides several improvements to the heap. The heap is used by many
applications and services including Windows components. The heap provides the capability to
dynamically allocate and free of data structures. Heap improvements include:
• Reduction in the amount of time required to create a heap, reducing process creation time.
• Capability of monitoring heap usage with Perfmon (enabled through the registry).
• A new type of heap in Windows Server 2003 called the low fragmentation heap (LFH). Applications and
services can select the LFH through an API. LFH improves performance and scalability while reducing the
potential for fragmentation.
• Reduction in the number of registry touches for each process that is created.
Summary
Kernel improvements in Windows Server 2003 provide scalability gains for large x86-based and 64-bit
systems with eight or more processors. Specifically, improved scheduling, memory management, kernel
spinlocks, and heap functionality coupled with enhancements to process creation, threads, handles,
objects, and named pipes give Windows Server 2003 significantly enhanced scalability on large
enterprise class multiprocessor systems.
Related Links
See the following resources for further information:
• Transaction Processing Performance Council Web site at www.tpc.org.
For the latest information about Windows Server 2003, see the Windows Server 2003 Web site at
http://www.microsoft.com/windowsserver2003.