mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 01:11:50 +02:00
4d330a61bb
smgrzeroextend() uses FileFallocate() to efficiently extend files by multiple blocks. When extending by a small number of blocks, use FileZero() instead, as using posix_fallocate() for small numbers of blocks is inefficient for some file systems / operating systems. FileZero() is also used as the fallback for FileFallocate() on platforms / filesystems that don't support fallocate. A big advantage of using posix_fallocate() is that it typically won't cause dirty buffers in the kernel pagecache. So far the most common pattern in our code is that we smgrextend() a page full of zeroes and put the corresponding page into shared buffers, from where we later write out the actual contents of the page. If the kernel, e.g. due to memory pressure or elapsed time, already wrote back the all-zeroes page, this can lead to doubling the amount of writes reaching storage. There are no users of smgrzeroextend() as of this commit. That will follow in future commits. Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: David Rowley <dgrowleyml@gmail.com> Reviewed-by: John Naylor <john.naylor@enterprisedb.com> Discussion: https://postgr.es/m/20221029025420.eplyow6k7tgu6he3@awork3.anarazel.de |
||
---|---|---|
.. | ||
.gitignore | ||
backendid.h | ||
barrier.h | ||
block.h | ||
buf_internals.h | ||
buf.h | ||
buffile.h | ||
bufmgr.h | ||
bufpage.h | ||
checksum_impl.h | ||
checksum.h | ||
condition_variable.h | ||
copydir.h | ||
dsm_impl.h | ||
dsm.h | ||
fd.h | ||
fileset.h | ||
freespace.h | ||
fsm_internals.h | ||
indexfsm.h | ||
ipc.h | ||
item.h | ||
itemid.h | ||
itemptr.h | ||
large_object.h | ||
latch.h | ||
lmgr.h | ||
lock.h | ||
lockdefs.h | ||
lwlock.h | ||
md.h | ||
meson.build | ||
off.h | ||
pg_sema.h | ||
pg_shmem.h | ||
pmsignal.h | ||
predicate_internals.h | ||
predicate.h | ||
proc.h | ||
procarray.h | ||
proclist_types.h | ||
proclist.h | ||
procsignal.h | ||
reinit.h | ||
relfilelocator.h | ||
s_lock.h | ||
sharedfileset.h | ||
shm_mq.h | ||
shm_toc.h | ||
shmem.h | ||
sinval.h | ||
sinvaladt.h | ||
smgr.h | ||
spin.h | ||
standby.h | ||
standbydefs.h | ||
sync.h |