Microsoft KB Archive/924749

= Event ID 2021 is logged even though lots of non-paged pool memory is available in Windows Server 2003 =

Article ID: 924749

Article Last Modified on 10/11/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard x64 Edition
 * Microsoft Windows Server 2003, Enterprise x64 Edition
 * Microsoft Windows Server 2003, Datacenter x64 Edition
 * Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
 * Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems

-



Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



SYMPTOMS
On a computer that is running Microsoft Windows Server 2003, you run System Monitor to monitor the non-paged pool bytes. System Monitor shows that lots of non-paged pool memory is still available. However, the following event is logged in the System log: Event ID: 2021

Source: Srv

Description: Server was unable to create a work item %2 times in the last %3 seconds.

Additionally, when you run System Monitor to collect performance data, the following conditions are true for all queues except the Blocking queue:
 * The Available Work Items counter of the Server Work Queues object is very low.
 * The Queue Length counter of the Server Work Queues object is 0 (zero).
 * The Borrowed Work Items counter of the Server Work Queues object is very high.



CAUSE
This problem may occur if the following conditions are true:
 * The cache line size of the CPU is less than 0x80.
 * The IRPStackSize parameter for the Server service is set to a value that ranges from 33 through 38.
 * The load on the Server service increases to a point where the Server service must allocate extra work items.



Service pack information
To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for Windows Server 2003

Prerequisites
To apply this hotfix, you must have Windows Server 2003 Service Pack 1 (SP1) installed on the computer. For more information about how to obtain the latest service pack for Windows Server 2003, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for Windows Server 2003

Restart requirement
You must restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

Windows Server 2003, x64-based versions


WORKAROUND
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

To work around this problem, specify the IRPStackSize parameter for the Server service in the registry. To do this, follow these steps:  Click Start, click Run, type regedit, and then click OK. Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters

 In the right pane, click IRPStackSize. Click Edit, and then click Modify. In the Edit DWORD Value dialog box, click Decimal under Base. In the Data Value box, type a value outside the range of 33 through 38. For example, type 29 or 40 .</li> Click OK.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows Server 2003 Service Pack 2.

<div class="moreinformation_section">

MORE INFORMATION
A work item is used to record details of a file I/O request from a remote client. A work item consists of a Server Work Item structure, an I/O request packet (IRP), and a Server Message Block (SMB) header and buffer. The size of the IRP is affected by the IRPStackSize parameter. The size of an SMB header is 0x70 bytes.

When the load on the Server service increases, the system has to allocate extra work items from the non-paged pool. Then, the system has to queue the work items for later processing. To improve performance, the Server service tries to align the SMB header in a work item on a CPU cache line boundary. The Server service also tries to make sure that the SMB header does not cross a page boundary.

However, if the cache line size of the CPU is less than the SMB header size of 0x70 and if the IRPStackSize parameter is very large, a conflict in the work item allocation code may occur. The Server service may align an SMB header on a cache line boundary that is very close to the end of a page. Therefore, the SMB header overlaps the page boundary. This scenario causes low performance. Event ID 2021 is logged when the allocation activity is rejected.

In this scenario, the Server service will acquire a non-paged pool block for a work item. However, the Server service will decide that the non-paged pool block is unusable because of alignment issues. Therefore, the Server service returns the non-paged pool block to the non-paged pool. Meanwhile, the Server service borrows a work item from another server work queue. When the load on the Server service increases, the demand for work items increases. However, the total number of work items remains fixed. Therefore, the Server service experiences low performance because there are not enough work items to accommodate the increased load.

The IRPStackSize parameter specifies the number of stack locations in IRPs that Microsoft Windows 2000 Server and Windows Server 2003 use. For more information about the IRPStackSize parameter, click the following article number to view the article in the Microsoft Knowledge Base:

285089 IRPStackSize parameter in Windows 2000 and Windows Server 2003

This problem does not occur on systems whose CPU cache line sizes are 0x80 or more.

This problem occurs on systems that have smaller cache line sizes if any one of the following conditions is true.

On Windows Server 2003-based computers
 * The CPU cache line size is 0x40, and the IRPStackSize parameter is decimal 35 or 36.
 * The CPU cache line size is 0x20, and the IRPStackSize parameter is decimal 35, 36, or 37.
 * The CPU cache line size is 0x10, and the IRPStackSize parameter is decimal 36 or 37.
 * The CPU cache line size is 0x08, and the IRPStackSize parameter is decimal 36, 37, or 38.

On Windows Server 2003 Service Pack 1 (SP1)-based computers
 * The CPU cache line size is 0x40, and the IRPStackSize parameter is decimal 33 or 34.
 * The CPU cache line size is 0x20, and the IRPStackSize parameter is decimal 33, 34, or 35.
 * The CPU cache line size is 0x10, and the IRPStackSize parameter is decimal 34 or 35.
 * The CPU cache line size is 0x08, and the IRPStackSize parameter is decimal 34 or 35.

Note The small differences between Windows Server 2003 and Windows Server 2003 SP1 are because of the size of the Server Work Item structure in Windows Server 2003 SP1.

Additional query words: Server Work Queues Borrowing

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver kbwinserv2003presp2fix kbwinserv2003sp2fix KB924749

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.