On 02/24/2012 08:41 AM, Stefan Hajnoczi wrote:
I dont think that it is cpu intense. All user pages are zeroed anyway, but at
allocation time it shouldnt be a big difference in terms of cpu power.
It's easy to find a scenario where eagerly zeroing pages is wasteful.
Imagine a process that uses all of physical memory. Once it
terminates the system is going to run processes that only use a small
set of pages. It's pointless zeroing all those pages if we're not
going to use them anymore.
In the long term, we will use them, except if the guest is completely idle.
The scenario in which zeroing is expensive is when the page is refilled
through DMA. In that case the zeroing was wasted. This is a pretty
common scenario in pagecache intensive workloads.