NT drivers that set up zone buffers for fast allocation of fixed-size blocks (also called entries) should use that memory economically.
When it initializes, the driver can call MmQuerySystemSize and MmIsThisAnNtAsSystem to get an estimate for sizing a zone buffer. MmQuerySystemSize returns a system-defined enumerated type, indicating whether the machine has a small, medium, or large amount of available memory. MmIsThisAnNtAsSystem returns TRUE if the current machine is a Windows NT server, which is likely both to have more memory available and to require a larger zone buffer to handle the I/O demand on the underlying driver(s)’ device(s).
Such a condition indicates a very heavy I/O demand for the driver’s device, so extending its zone buffer might be worthwhile. That is, the performance gain from allocating additional zone blocks might allow the driver to process requests fast enough to compensate for its additional “permanent” demand on nonpaged pool, especially if extending the zone allows the driver to release some of the temporary memory it allocated with ExAllocatePool or ExAllocatePoolWithTag.
Note that an NT driver’s successful call to ExExtendZone or ExInterlockedExtendZone allocates nonpaged pool that remains allocated to the driver until the system is rebooted. Consequently, any NT driver that calls ExExtendZone or ExInterlockedExtendZone whenever its zone buffer becomes full (that is, all entries are currently allocated), can eventually run out of nonpaged pool. Such a driver also can put the system into a low-memory state such that all I/O throughput becomes very slow, including the “memory-hogging” driver’s.
For routine-specific information about the Ex..Zone routines, see the Kernel-Mode Driver Reference.