This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, 17 Jan 2007, Corinna Vinschen wrote: > On Jan 16 17:28, Brian Ford wrote: > > > PS: In an strace of this, I see three fstat64s called from within a > > single mmap64. Do you know where they all are, and if two should be > > optimized away? > > There's only one such call in list::set. which is called from map::add_list, yes. I also see one in map::get_list_by_fd. > Your observation is strange. The first mapping, which really maps the > file, calls fstat. The second (valid remainder) and third (sigbus area) > mapping are anonymous mappings, which don't call fstat. I don't think my three fstat64s correspond to your three mappings. > In my tests, fstat64 is called only once for a file mapping. Really? I think I see them as follows: mmap.cc:1203 mmap64(): map_list = mmapped_areas.get_list_by_fd (fd); mmap.cc:982 mmap_worker(): if (!(map_list = mmapped_areas.get_list_by_fd (fd)) mmap.cc:983 mmap_worker(): && !(map_list = mmapped_areas.add_list (fd))) Also: mmap.cc:1134 mmap64(): DWORD low = GetFileSize (fh->get_handle (), &high); > STC? It looks like your statement is true for the first mmap in a process, but subsequent mmaps have significant overhead. In the attached STC, I count 5 fstat64s of the same fd via strace, plus the GetFileSize mentioned above. PS. Since this isn't a bug, I don't expect you to do any more than consider putting it in your long term low priority que or reply with a PTC Thanks for the evaluation tuits ;-). -- Brian Ford Lead Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International the best safety device in any aircraft is a well-trained crew...
Attachment:
mmaptest.c
Description: Text document
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |