I did some testing with relatively small messages, 50 bytes or so, with results
as follows:
Without any explicit flushing it takes 8 usec to log a message.
If I msync() only the pages that were touched in writing (usually 3 pages) it
takes 39 usecs to log a message.
If I fsync() the entire file (200KB) it takes 12 usec to log a message.
Why the additional cost for msync()? I would have thought it would be faster
since it is explicitely for mmapped memory areas. As a side note, the
difference is even more extreme if a file is used on a disk-backed filesystem.
The kernel was 2.4.18.
Chris
-- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.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/