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

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

很多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,用来唯一标示分配内存的驱动程序,并且在跟踪驱动程序是否缺少池十分有用。

目录
相关文章
|
Shell Docker 容器
在shell中启动进程
在shell中启动进程
468 2
|
存储 Dragonfly 缓存
Nydus:开源的下一代容器镜像加速服务
让更多的容器用户能够体验到容器快速启动和安全加载方面的能力。
7791 0
Nydus:开源的下一代容器镜像加速服务
|
Ubuntu Linux Shell
Ubuntu/linux系统环境变量配置详解
理解和掌握如何配置环境变量对于使用和管理Ubuntu/Linux系统非常重要。
539 2
|
机器学习/深度学习 人工智能 安全
操作系统的未来:智能化与安全性的融合之路
本文旨在探讨操作系统在技术革新中的发展轨迹,特别是智能化和安全性如何成为推动现代操作系统前进的关键力量。文章首先概述了操作系统的基本功能和历史演变,随后深入分析了智能化技术如人工智能、机器学习如何被整合进操作系统以提升用户体验与系统效率。同时,文中详细讨论了网络安全威胁的日益增加对操作系统安全性的挑战,以及开发者是如何应对这些挑战的。最终,本文展望了未来操作系统可能的发展方向,强调了持续创新和跨学科合作的重要性。 【7月更文挑战第25天】
209 2
|
Kubernetes 搜索推荐 Docker
Kubernetes容器运行时:Containerd vs Docke
Kubernetes容器运行时:Containerd vs Docke
1316 4
|
移动开发 前端开发 JavaScript
UniApp H5项目大揭秘:高效生成与扫描二维码的终极策略,让你的应用脱颖而出!
【8月更文挑战第3天】UniApp让开发者能以Vue.js构建跨平台应用。在H5项目中,通过第三方库如qrcodejs2可轻松生成二维码,代码简洁易集成;或用Canvas API获得更高灵活性。扫描方面,H5+ API适合App环境,而纯H5项目则需前端库加后端服务配合。不同方法各有优势,应按需选择以优化体验。
744 0
|
Android开发 开发者
安卓投屏神器 Scrcpy安 报错ERROR: Could not find any ADB device
使用Scrcpy安卓投屏工具时遇到报错,问题根源是未开启开发者模式。解决步骤:进入设置,点击【关于手机】→连续点击版本号激活开发者模式,然后在【系统设置】→【开发者选项】中开启USB调试。参照此方法后可正常执行。Scrcpy软件下载链接和GitHub页面也已提供。
1901 1
|
运维 资源调度 监控
云上故障排查:高效定位与解决云端挑战的实战指南
加强监控与告警:建立完善的监控体系,确保能够及时发现并处理潜在问题。 定期演练与培训:定期组织故障排查演练和技能培训,提高团队的应对能力和专业水平。 注重数据保护与隐私:在故障排查过程中,严格遵守数据保护和隐私保护的相关规定,确保用户数据的安全。 结语 云上故障排查是一项复杂而艰巨的任务,需要企业和IT团队具备高度的专业素养和应对能力。通过遵循基本原则、运用有效工具与方法、遵循实战步骤并采纳最佳实践,我们可以
1211 0
|
网络协议
服务器端口被占用怎么解决
服务器端口被占用怎么解决