lkml.org 
[lkml]   [1999]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Tasks raising to 95% of %CPU / SOLVED
Hello Eduardo.

This sounds exactly like a problem which we encountered some time
ago with our database system.

As a workaround, we use a patch from Scott Laird
<laird@pacificrim.net>
which changes ext2_sync_file() to fall back to file_fsync() when the
file size exceeds a a few MB. Due to the way ext2_sync_file() is
implemented it is deemed to cause trouble when performing an fsync()
on bigger files (which is required for databases).

Maybe something like this should be included in 2.0.37 until a more
efficient way is found to deal with fsync() on bigger files (eg. keep
a list of modified blocks per file).


Michael

--
Michael Marxmeier Marxmeier Software GmbH
E-Mail: mike@msede.com Besenbruchstrasse 9
Voice : +49 202 2431440 42285 Wuppertal, Germany
Fax : +49 202 2431420 http://www.msede.com/--- linux-2.0.36/fs/ext2/fsync.c.orig Mon Feb 1 03:35:25 1999
+++ linux-2.0.36/fs/ext2/fsync.c Mon Feb 1 03:42:04 1999
@@ -10,6 +10,8 @@
* linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds
*
* ext2fs fsync primitive
+ *
+ * Fast 'fsync' on large files (Scott Laird <laird@pacificrim.net>)
*/

#include <asm/segment.h>
@@ -172,6 +174,13 @@
* Don't sync fast links!
*/
goto skip;
+
+ /* fsync on large files is *slow*, so fall back to sync() if
+ * the file's over 10M */
+ if (inode->i_size>10000000) {
+ file_fsync(inode,file);
+ goto skip;
+ }

for (wait=0; wait<=1; wait++)
{
\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.128 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site