From: Simon Wilkinson Date: Mon, 17 May 2010 19:15:46 +0000 (+0100) Subject: Fileserver: Don't sync every 10 seconds X-Git-Tag: openafs-devel-1_5_75~268 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=5ea24a7c5534b4fda7904284d21d34b6e52a3f27 Fileserver: Don't sync every 10 seconds The patch which moved our calls to fsync into the background, added a sync prior to each batch of fsync calls. This is an incredibly bad idea. POSIX says that sync "shall cause all information in memory that updates file systems to be scheduled for writing out to all file systems". On Linux this means that we in effect perform an fsync() on every open filehandle on the entire system, and in addition flush all superblocks and journals out to disk. This makes the following fsync() calls superfluous - sync() will have already written out all of the data. Add to this the fact that the fileserver is doing this every 10 seconds, and this becomes a major performance bottleneck, particularly if the machine uses a journalled fs - as any disk operations will end up blocking whilst the journal is written to disk. Change-Id: Id06cb99ae83af2e4a82e7b20fb14b8457dc16883 Reviewed-on: http://gerrit.openafs.org/1977 Reviewed-by: Andrew Deason Reviewed-by: Rainer Toebbicke Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index b35d890..8b2f3dc 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -984,9 +984,6 @@ ih_sync_thread(void *dummy) { IOMGR_Sleep(60); #endif /* AFS_PTHREAD_ENV */ -#ifndef AFS_NT40_ENV - sync(); -#endif ih_sync_all(); } return NULL;