【翻译WINDOWS NT FILE SYSTEM INTERNAL】NT缓存管理器一(2)

本文深入探讨了NT缓存管理器的功能与作用,详细解释了其如何与NT虚拟内存管理器协同工作,为文件数据执行预读并提供延迟写功能,从而显著提升文件连续读取操作的性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

功能

NT缓存管理器是NT执行体中一个distinct component(清晰的组件),而且他和NT虚拟内存管理器密切合作。

它位存储在二级存储设备上的数据提供(consistent systemwide cache)一致的全系统范围的数据缓存.这些缓存被适当关联的文件系统驱动管理,并与虚拟内存管理器和I/O管理器协同作业。

他为文件数据执行预读。缓存管理器尝试根据每个文件数据的应用程序访问模式来调整它的缓存策略。因为所有到被缓存文件的I/O请求都要经过缓存管理器,所以缓存管理器可以跟踪文件数据的访问模式。因此,如果一个应用程序读一个文件的前10K字节,NT缓存管理器将把接下来的64K字节文件数据预读进内存。随后,如果应用程序尝试获取这些数据,这些数据可以简单的从系统缓存中拷贝,得以避免应用程序等待直到数据被从二级存储中读出。对于连续读文件操作,缓存管理器的预读功能可以带来明显的性能提升,因为在应用程访问哪些数据之前,数据已经被读入到system volatile memory(系统易失性内存)。

它为被修改的缓存数据提供延迟写功能。通过在写入硬盘之前,将被修改数据在内存中保持一段时间,缓存管理器为实际执行写操作的应用程序提供较强的响应能力。它仅仅是将一批并发的邻近的内存写操作和写出所有被修改数据字节的操作放入一个单独的I/O操作,这显然比单独执行每个小的写操作效率更高。最后,一个应用程序可以重复的修改相同的字节围成为可能。为了延迟I/O到磁盘,一些修改可以仅在内存中进行,避免完全的overhead(过度的)重复对媒介执行写操作。

npm ERR! code 1 npm ERR! path D:\work\opscloud4\opscloud4-web-master\node_modules\deasync npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./build.js npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@10.0.1 npm ERR! gyp info using node@18.19.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.12.3 found at "C:\Users\27145\AppData\Local\Programs\Python\Python312\python.exe" npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details npm ERR! gyp ERR! find VS looking for Visual Studio 2015 npm ERR! gyp ERR! find VS - not found npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. npm ERR! gyp ERR! find VS For more information consult the documentation at: npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use npm ERR! gyp ERR! stack at VisualStudioFinder.fail (D:\ProgramFile\developTool\nvm\nvm\v18.19.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:113:11) npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio (D:\ProgramFile\developTool\nvm\nvm\v18.19.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:69:17) npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5) npm ERR! gyp ERR! stack at async createBuildDir (D:\ProgramFile\developTool\nvm\nvm\v18.19.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:69:26) npm ERR! gyp ERR! stack at async run (D:\ProgramFile\developTool\nvm\nvm\v18.19.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18) npm ERR! gyp ERR! System Windows_NT 10.0.26100 npm ERR! gyp ERR! command "D:\\ProgramFile\\developTool\\nvm_nodejs\\nodejs\\node.exe" "D:\\ProgramFile\\developTool\\nvm\\nvm\\v18.19.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd D:\work\opscloud4\opscloud4-web-master\node_modules\deasync npm ERR! gyp ERR! node -v v18.19.0 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not ok npm ERR! Build failed
最新发布
06-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值