Relation between RAM and CPU utilization


We have a storport miniport driver for our RAID adapter. This is a full duplex driver and has passed the WHQL. We are using DPCs to process most of the IOs.

While running IO stress test on Windows Server 2012R2 OS, we observed that the CPU utilization is touching 100% when there is less RAM (16GB) present in the system.
However when we increase the RAM to 64GB in the same configuration with the same IO pattern, the CPU utilization comes down to around 35-40%.
What is the relation between the RAM and CPU utilization, with lesser RAM consuming so much of the CPU?

I also have one more doubt.
For how long the mapping between the physical address returned by StorPortGetPhysicalAddress and the corresponding virtual address be valid? Here I am using the virtual address in the memory range returned by StorPortGetUncachedExtension.
Will I get the same physical address every time I call StorPortGetPhysicalAddress for the given virtual address returned by StorPortGetUncachedExtension?


I guess the answer is in the Active and Standby list dynamics.

When there are plenty of memory the system keeps more pages in the Active and Standby lists. Most of the page faults are soft faults - the system updates only a PTE entry in the process page table without initiating IO from a disk as the page has been found in the Standby list. The system keeps file cache and mapped files, user and kernel stacks, process private, shared and COW pages in the Standby list. The Working Set Manager is also less aggressive in virtual to physical unmapping that moves pages from the Active lists to the Modified or Standby list so less page faults happens.

The system tries to keep more pages in the Active and Standby lists which reduces IO and thus requires less CPU time to keep system running. In the extreme case all process’s pages are in the Active, Standby or Modified lists which requires only to flush dirty pages and all page faults are soft one.

Uncached extension is basically the same as a common buffer. It may not really be uncached, but you can do DMA to it. This means it’s locked and contiguous.