Re: How to find out which pages were copied-on-write?

From: Lutz Vieweg
Date: Tue Jul 13 2004 - 08:06:27 EST


Michael Clark wrote:

But wouldn't that introduce a significant overhead and undermine all of the
nice advantages the kernel might have in scheduling I/O operations?
Not really. Plain read/write IO is generally faster than mmap IO anyway.

Well, that was my result, too, when I measured mmap() vs. read()/write()
with the 2.4.x kernels, however, I was quite impressed recently when
I measured write operations with MAP_SHARED regions under 2.6.7
(CPU x86_64), they were not at all slower than ordinary write()s.
(congratulations to the involved kernel hackers on that! :-)

You don't use mmap for speed but rather for convenience.

But isn't an advantage with mmap() that there's no need for the kernel
to copy what is to be written to a dedicated buffer? The kernel
could initiate DMA writes directly from the working memory...

Regards,

Lutz Vieweg


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/