mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Change s_lock to not use any zero-delay select() calls; these are just a
waste of cycles on single-CPU machines, and of dubious utility on multi-CPU machines too. Tweak s_lock_stuck so that caller can specify timeout interval, and increase interval before declaring stuck spinlock for buffer locks and XLOG locks. On systems that have fdatasync(), use that rather than fsync() to sync WAL log writes. Ensure that WAL file is entirely allocated during XLogFileInit.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.72 2001/02/17 01:00:04 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.73 2001/02/18 04:39:42 tgl Exp $
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
@ -193,7 +193,7 @@ static char *filepath(char *filename);
|
||||
static long pg_nofile(void);
|
||||
|
||||
/*
|
||||
* pg_fsync --- same as fsync except does nothing if -F switch was given
|
||||
* pg_fsync --- same as fsync except does nothing if enableFsync is off
|
||||
*/
|
||||
int
|
||||
pg_fsync(int fd)
|
||||
@ -204,6 +204,26 @@ pg_fsync(int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* pg_fdatasync --- same as fdatasync except does nothing if enableFsync is off
|
||||
*
|
||||
* Not all platforms have fdatasync; treat as fsync if not available.
|
||||
*/
|
||||
int
|
||||
pg_fdatasync(int fd)
|
||||
{
|
||||
if (enableFsync)
|
||||
{
|
||||
#ifdef HAVE_FDATASYNC
|
||||
return fdatasync(fd);
|
||||
#else
|
||||
return fsync(fd);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* BasicOpenFile --- same as open(2) except can free other FDs if needed
|
||||
*
|
||||
|
Reference in New Issue
Block a user