munmap slowness; IsBadReadPtr considered harmful

Brian Ford ford@vss.fsi.com
Fri Feb 20 17:54:00 GMT 2004


Using strace, I traced a severe performance problem with one of our apps
to munmap.  That call was taking an extrodinarily long time to complete,
especially if the file to be unmapped was on a network drive.

By adding more strace log messages, I narrowed the problem down to the
IsBadReadPtr check for a vaild address range.  Further more, using
Sysinternals filemon, I found that IsBadReadPtr appears to be faulting in
every non-resident page in the range.  That obviously explains the slow
down, especially for files on network drives.

So, the question is, does anyone have any idea how to perform the validity
check without faulting in the entire address range we're about to dump?

Thanks.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444



More information about the Cygwin-developers mailing list