[PATCH][RFC] speeding up fsck -A

Olaf Dietsche
2003-07-20T22:46:43Z

With this patch, I get a speedup of about 60%. During boot time it is
even more. Can someone please tell me, why and when this WNOHANG was
introduced. fsck seems to work fine without it.

You will probably gain nothing on SMP, because it doesn't hurt when
fsck hogs one CPU and the real fsck.ext2 does the main work on
another CPU.

This is on Debian unstable and kernel 2.5.72.

Regards, Olaf.

--- e2fsprogs/misc/fsck.c.orig Wed Apr 16 22:13:56 2003
+++ e2fsprogs/misc/fsck.c Sun Jul 20 23:35:03 2003
@@ -105,6 +105,7 @@
int parallel_root = 0;
int progress = 0;
int force_all_parallel = 0;
+int no_busy_waiting = 0;
int num_running = 0;
int max_running = 0;
volatile int cancel_requested = 0;
@@ -1007,7 +1008,8 @@
break;
if (verbose > 1)
printf(_("--waiting-- (pass %d)\n"), passno);
- status |= wait_all(pass_done ? 0 : WNOHANG);
+ status |= wait_all((pass_done || no_busy_waiting) ? 0 : WNOHANG);
+
if (pass_done) {
if (verbose > 1)
printf("----------------------------------\n");
@@ -1153,6 +1155,9 @@
fstype = string_copy(tmp);
compile_fs_type(fstype, &fs_type_compiled);
goto next_arg;
+ case 'X':
+ no_busy_waiting++;
+ break;
case '-':
opts_for_fsck++;
break;