Hi,
When analyzing the kernel profile from osdl dbt benchmarks, I noticed
that around 50% of the kernel time is spent in __copy_user_intel.
http://khack.osdl.org/stp/280060/profile/
This function is one of two functions that does the actual memory copy
from/to kernel space to/from user space.
Unfortunately it's the slower one: Intel cpus have a microcode fastpath
for memcopies that are 8-byte aligned. This fastpath is around 50%
faster than the manual copy that is used for "misaligned" (i.e. only
4-byte aligned) pointers. I don't know enough about other cpus, but I'd
expect that most cpus prefer well-aligned buffers.
How are the user space buffers allocated?
So far I found buffile.c, but "struct BufFile.buffer" is at offset 32,
i.e. aligned, although by chance. What is the alignment of the output of
palloc? Is buffile.c the main code that reads/writes data to disk?
-- Manfred