2011/10/8 Richard Braun <rbr...@sceen.net>: > On Sat, Oct 08, 2011 at 01:55:42AM +0200, Sergio López wrote: >> Nowadays, the copy strategy is decided per-object, but I think the >> desired type of access to an object should also be considered. For >> instance, the operation generated by vm_copy should almost always use >> COPY_NONE, while vm_map, when doing things such as providing a private >> map, should use COPY_DELAY. > > I really don't see why vm_copy() should use COPY_NONE. Could you explain > it briefly (sorry if I'm asking about something you may already have > described, but I feel it would be better with a clear, simple, > centralized explanation).
vm_object_copy_delayed(), which is being used when copying from an object with the MEMORY_OBJECT_COPY_DELAY attribute, is not designed for doing small, repetitive reads from an object (which is what we're usually doing with vm_copy). Using it this way is slower than copying the pages without any optimization (as with MEMORY_OBJECT_COPY_NONE).