]> git.hungrycats.org Git - linux/commitdiff
[PATCH] speed up sys_sync()
authorAndrew Morton <akpm@digeo.com>
Wed, 25 Sep 2002 14:22:19 +0000 (07:22 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 25 Sep 2002 14:22:19 +0000 (07:22 -0700)
Well it's a one-liner.  sys_sync() only syncs one queue at a time, and
can be slow if you have a lot of disks.  So poke pdflush, which knows
how to write all the queues in parallel.

fs/buffer.c

index 3b8477f2aca7d9adab27ca96c5fb520a52e8f4bc..4f1c380230be43dd228b924b046c6726f29acbd7 100644 (file)
@@ -242,10 +242,12 @@ int fsync_bdev(struct block_device *bdev)
 }
 
 /*
- * sync everything.
+ * sync everything.  Start out by waking pdflush, because that writes back
+ * all queues in parallel.
  */
 asmlinkage long sys_sync(void)
 {
+       wakeup_bdflush(0);
        sync_inodes(0); /* All mappings and inodes, including block devices */
        DQUOT_SYNC(NULL);
        sync_supers();  /* Write the superblocks */