Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zero filling pages



On Tuesday, July 22, 2003, at 8:39 PM, Nat! wrote:

Probably a FAQ, but OK anyway :)

Whenever I allocate memory with vm_allocate I get a zero filled paged. AFAIK I can't get around this for security reasons, the reason being that another process should not look into another processes memory space, to glean some information.

OK two questions:

Is there really no (reasonable easy) way to get around this ? Zero filling is my bottleneck currently.

I don't have the hard facts to back this up... but...

Its been my growing impression that the fault cost (trip into the kernel, then back out)
and the page allocation cost tend to dwarf the zero-fill cost. This is loosely based on
my observed timings for relatively nop-like system calls, the zero-fill performance of
routines like bzero and the average performance of code that is zero-fill/fault-limited.

I not going to touch the necessity for zero-filling, but what I am curious about is the
potential performance gains that can be had from getting rid of the other overhead.
What if there was an option to vm_allocate (and its ilk) that made it allocate pages for
a request synchronously at the time of allocation. When a task knows it'll immediately
touch the full range its about to allocate this would get rid of the fault overhead entirely,
and probably some of the page allocation costs due to less lock grabbing, better cache
locality, etc. Obviously, this would never be a default behavior.

-Ed
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >zero filling pages (From: Nat! <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.