[discussing unaligned mmap]
> The only way to guarantee coherency is to guarantee that everybody
> has the same physical page - which in turn means that everybody
> has to agree on alignment. Thus the page-alignment requirement.
You can guarantee coherency without the page-alignment requirement.
Let's say you have a machine with 4 kB pages. Process X maps a 4 kB
area with normal alignment, and Process Y maps an overlapping area
with 2 kB alignment. (the areas overlap by 2 kB)
Process X runs first. After an initial page fault, it writes to the
overlapping area. Process Y runs second. It takes a page fault that
marks the shared region as not present in process X, then gets an
updated copy of the shared area. (the kernel copies 2 kB)
The copy only happens often if multiple processes are writing to
overlapping unaligned regions. This can't even be done right now,
so I don't think the cost is a serious problem.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/