Messages in this thread | | | Subject | Re: mmap(MAP_PRIVATE) question | From | Gianni Tedesco <> | Date | Wed, 03 Sep 2003 15:37:08 +0200 |
| |
On Wed, 2003-09-03 at 12:28, Jamie Lokier wrote: > The page cache page is mapped into the application just like a shared > mapping, until the application writes to the mapped region and > triggers the copy-on-write fault.
that clears it up somewhat :)
> On the other hand you may not. On some of the architectures which > Linux supports, the CPU's cache is not sufficiently coherent to > guarantee that what is written with write(), or by another process, > will be seen in this application's memory. Indeed, you might see a > mixture of some of the written data and some of the data before it was > written, with no particular guarantee of which bits of data or in what > order.
Well, the thing I'm interested in is people overwriting parts of shared libraries (at least those opened with dlopen). In my tests, I am using mmap/msync to overwrite the library rodata section with MS_SYNC|MS_INVALIDATE. When I do this the running copy (using MAP_PRIVATE) appears unmodified, but no ETXTBSY error is given. What you are saying would seem to indicate that the running program *should* be modified.
Perhaps MS_INVALIDATE doesn't bother invalidating MAP_PRIVATE mappings? Or am I missing a trick here? :)
(this is on intel btw).
-- Gianni Tedesco <giannit@securewave.com>
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |