Nonpaged Pool(非分页池) 和 Paged Pool(分页池) 在Windows中的用处

简介:

很多DBA对nonpage pool 和 paged pool 搞不太清楚干嘛用的,看perfmon中的说明也看得稀里糊涂。找到一个资料就翻译一下。

From:http://blogs.technet.com/b/markrussinovich/archive/2009/03/26/3211216.aspx

Nonpaged Pool(非分页池)

The kernel and device drivers use nonpaged pool to store data that might be accessed when the system can’t handle page faults. The kernel enters such a state when it executes interrupt service routines (ISRs) and deferred procedure calls (DPCs), which are functions related to hardware interrupts. Page faults are also illegal when the kernel or a device driver acquires a spin lock, which, because they are the only type of lock that can be used within ISRs and DPCs, must be used to protect data structures that are accessed from within ISRs or DPCs and either other ISRs or DPCs or code executing on kernel threads. Failure by a driver to honor these rules results in the most common crash code, IRQL_NOT_LESS_OR_EQUAL.

内核或者设备驱动使用非分页池来保存可能访问的数据,但是在访问的时候又不能出现也错误。当内核执行中断服务程序并且延迟调用过程的时候就会进入这种状态,这个状态和硬件中断相关联。当内核或者设备驱动在这个状态后,获取了一个自旋锁,页错误也是不被允许的,自旋锁是唯一能在延迟调用或者中断服务程序中能用的锁类型,用来保护被延迟过程调用和中断服务程序访问的数据,可能来自于延迟过程调用和中断服务程序,也可能来自其他的延迟过程调用和中断服务程序,或者其他的内核线程。如果驱动程序在执行整个规则的时候出错会得到一个 IRQL_NOT_LESS_OR_EQUAL 的崩溃代码

Nonpaged pool is therefore always kept present in physical memory and nonpaged pool virtual memory is assigned physical memory. Common system data structures stored in nonpaged pool include the kernel and objects that represent processes and threads, synchronization objects like mutexes, semaphores and events, references to files, which are represented as file objects, and I/O request packets (IRPs), which represent I/O operations.

非分页池因此总是报错在内存中,非分页池的虚拟地址被物理地址分配。通用的系统数据结构被保存在非分页池中包含内核和代表进程和线程的对象,互斥对象,同步信号量,引用文件(代表文件对象),和I/O请求包(代表I/O操作)

Paged Pool(分页池)

Paged pool, on the other hand, gets its name from the fact that Windows can write the data it stores to the paging file, allowing the physical memory it occupies to be repurposed. Just as for user-mode virtual memory, when a driver or the system references paged pool memory that’s in the paging file, an operation called a page fault occurs, and the memory manager reads the data back into physical memory. The largest consumer of paged pool, at least on Windows Vista and later, is typically the Registry, since references to registry keys and other registry data structures are stored in paged pool. The data structures that represent memory mapped files, called sections internally, are also stored in paged pool.

分页池,从字面意思来说,也就是可以存到系统的分页文件中,允许物理内存重定向。如用户模式的虚拟内存,当驱动或者系统引用分页池内存在分页文件中,那么一个操作就会调用页错误,内存管理系统把数据从分页文件中读取到物理内存。在windows vista和之后的版本,分页池最大的使用者是注册表,引用的注册键值和其他注册表数据都是存储在分页池中。内存映射文件(内部叫做内存对象[Sections])也存在分页池中。

 

Device drivers use the ExAllocatePoolWithTag API to allocate nonpaged and paged pool, specifying the type of pool desired as one of the parameters. Another parameter is a 4-byte Tag, which drivers are supposed to use to uniquely identify the memory they allocate, and that can be a useful key for tracking down drivers that leak pool, as I’ll show later.

设备驱动可以使用ExAllocatePoolWithTag API来申请非分页池和分页池,可以使用参数来指定在那个类型的池中申请。另外一个参数是4个字节的tag,用来唯一标示分配内存的驱动程序,并且在跟踪驱动程序是否缺少池十分有用。



    本文转自 Fanr_Zh 博客园博客,原文链接:http://www.cnblogs.com/Amaranthus/archive/2012/11/15/2771523.html,如需转载请自行联系原作者





相关文章
|
网络架构 Windows
使用Windows Server 2012 R2创建DHCP作用域(DHCP地址池),并测试使用
使用Windows Server 2012 R2创建DHCP作用域(DHCP地址池),并测试使用
321 0
|
缓存 Linux iOS开发
WINDOWS C盘各个目录的用处
WINDOWS C盘各个目录的用处
262 0
|
7天前
|
监控 安全 网络安全
Windows Server管理:配置与管理技巧
Windows Server管理:配置与管理技巧
32 3
|
10天前
|
存储 安全 网络安全
Windows Server 本地安全策略
由于广泛使用及历史上存在的漏洞,Windows服务器成为黑客和恶意行为者的主要攻击目标。这些系统通常存储敏感数据并支持关键服务,因此组织需优先缓解风险,保障业务的完整性和连续性。常见的威胁包括勒索软件、拒绝服务攻击、内部威胁、恶意软件感染等。本地安全策略是Windows操作系统中用于管理计算机本地安全性设置的工具,主要包括用户账户策略、安全选项、安全设置等。实施强大的安全措施,如定期补丁更新、网络分段、入侵检测系统、数据加密等,对于加固Windows服务器至关重要。
|
1月前
|
边缘计算 安全 网络安全
|
1月前
|
数据安全/隐私保护 Windows
安装 Windows Server 2019
安装 Windows Server 2019
|
1月前
|
网络协议 Windows
Windows Server 2019 DHCP服务器搭建
Windows Server 2019 DHCP服务器搭建
|
1月前
|
网络协议 定位技术 Windows
Windows Server 2019 DNS服务器搭建
Windows Server 2019 DNS服务器搭建