The system does guarantee it. There is no special case for SIGKILL exit,
it is just an ordinary exit and it does properly munmap all your mappings.
> 2) If I make changes to the contents of an mmap()'d file, am I guaranteed that
> the order I make the changes is the same order that they will be available to
> another process that has mmap()'d the same file? (Or can I be bit by
> optimization reordering? If this is the case, can I get around this by reading
> it as volatile and using the barrie() macro?)
When two processes access the same mapping in Linux they always work
on the same block of memory, so standard memory ordering rules apply.
On a lot of architectures that means you need to use appropiate read and
write barriers to avoid reordering on SMP systems.
[on some architectures like early mips chips there can be nasty issues
with virtual cache aliases though, but that should not concern you here]
The memory can be flushed to disk and reread at any time, in this
regard it is no different from any other anonymous memory, except that
it is not written to swap but to your backing file.
The order in which the changes are flushed to disk is completely undefined.
-Andi
-
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/