1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 22:06:20 +02:00
git/compat
Neeraj Singh abf38abec2 core.fsyncmethod: add writeout-only mode
This commit introduces the `core.fsyncMethod` configuration
knob, which can currently be set to `fsync` or `writeout-only`.

The new writeout-only mode attempts to tell the operating system to
flush its in-memory page cache to the storage hardware without issuing a
CACHE_FLUSH command to the storage controller.

Writeout-only fsync is significantly faster than a vanilla fsync on
common hardware, since data is written to a disk-side cache rather than
all the way to a durable medium. Later changes in this patch series will
take advantage of this primitive to implement batching of hardware
flushes.

When git_fsync is called with FSYNC_WRITEOUT_ONLY, it may fail and the
caller is expected to do an ordinary fsync as needed.

On Apple platforms, the fsync system call does not issue a CACHE_FLUSH
directive to the storage controller. This change updates fsync to do
fcntl(F_FULLFSYNC) to make fsync actually durable. We maintain parity
with existing behavior on Apple platforms by setting the default value
of the new core.fsyncMethod option.

Signed-off-by: Neeraj Singh <neerajsi@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-10 15:10:22 -08:00
..
linux tr2: log N parent process names on Linux 2021-09-07 11:08:00 -07:00
nedmalloc win32: allow building with pedantic mode enabled 2021-09-03 11:40:30 -07:00
poll mingw: workaround for hangs when sending STDIN 2020-02-27 14:23:29 -08:00
regex compat/regex: move stdlib.h up in inclusion chain 2020-04-27 11:21:16 -07:00
simple-ipc simple-ipc: work around issues with Cygwin's Unix socket emulation 2021-11-10 09:12:19 -08:00
stub tr2: make process info collection platform-generic 2021-07-22 13:35:20 -07:00
vcbuild Makefile: stop hardcoding {command,config}-list.h 2021-09-23 15:06:47 -07:00
win32 core.fsyncmethod: add writeout-only mode 2022-03-10 15:10:22 -08:00
.gitattributes Provide zlib's uncompress2 from compat/zlib-compat.c 2021-10-08 10:45:48 -07:00
access.c git-compat-util: work around for access(X_OK) under root 2019-04-25 17:49:44 +09:00
apple-common-crypto.h
basename.c
bswap.h compat/bswap.h: don't assume MSVC is little-endian 2020-11-11 11:24:47 -08:00
compiler.h bugreport: add compiler info 2020-04-16 15:23:42 -07:00
fileno.c git-compat-util: work around for access(X_OK) under root 2019-04-25 17:49:44 +09:00
fopen.c git_fopen: fix a sparse 'not declared' warning 2017-05-26 12:33:55 +09:00
hstrerror.c
inet_ntop.c
inet_pton.c
memmem.c
mingw.c getcwd(mingw): handle the case when there is no cwd 2022-01-19 11:27:31 -08:00
mingw.h core.fsyncmethod: add writeout-only mode 2022-03-10 15:10:22 -08:00
mkdir.c
mkdtemp.c
mmap.c compat: let git_mmap use malloc(3) directly 2021-08-24 14:43:45 -07:00
msvc.c
msvc.h msvc: add pragmas for common warnings 2019-06-25 10:46:57 -07:00
obstack.c compat/obstack: fix -Wcast-function-type warnings 2019-01-17 11:13:38 -08:00
obstack.h obstack: avoid computing offsets from NULL pointer 2020-01-28 23:13:25 -08:00
open.c Makefile: add OPEN_RETURNS_EINTR knob 2021-02-26 14:15:51 -08:00
pread.c
precompose_utf8.c precompose_utf8: make precompose_string_if_needed() public 2021-04-05 17:30:04 -07:00
precompose_utf8.h precompose_utf8: make precompose_string_if_needed() public 2021-04-05 17:30:04 -07:00
qsort_s.c compat/qsort_s.c: avoid using potentially unaligned access 2022-01-07 14:20:58 -08:00
setenv.c
sha1-chunked.c
sha1-chunked.h
snprintf.c
stat.c
strcasestr.c
strdup.c compat: move strdup(3) replacement to its own file 2016-09-07 10:41:45 -07:00
strlcpy.c
strtoimax.c
strtoumax.c
terminal.c terminal: teach git how to save/restore its terminal settings 2021-10-06 08:53:00 -07:00
terminal.h terminal: teach git how to save/restore its terminal settings 2021-10-06 08:53:00 -07:00
unsetenv.c unsetenv(3) returns int, not void 2021-10-29 15:00:58 -07:00
win32.h
win32mmap.c
winansi.c wrapper: make inclusion of Windows csprng header tightly scoped 2022-03-10 15:10:22 -08:00
zlib-uncompress2.c compat: auto-detect if zlib has uncompress2() 2022-01-26 09:05:55 -08:00