linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RFC] speeding up fsck -A
@ 2003-07-20 23:01 Olaf Dietsche
  2003-07-22  1:04 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Olaf Dietsche @ 2003-07-20 23:01 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][RFC] speeding up fsck -A
  2003-07-20 23:01 [PATCH][RFC] speeding up fsck -A Olaf Dietsche
@ 2003-07-22  1:04 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2003-07-22  1:04 UTC (permalink / raw)
  To: Olaf Dietsche; +Cc: linux-kernel, linux-fsdevel

On Mon, Jul 21, 2003 at 01:01:44AM +0200, Olaf Dietsche wrote:
> 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.

This isn't a kernel problem; you should have just sent it to me
directly as an e2fsprogs maintainer, as documented in the README file
in the e2fsprogs source tree, or in /usr/shared/doc/e2fsprogs/README
on a Debian system, instead of bothering folks on the kernel list.

In any case, thanks for reporting this bug; I've fixed it
appropriately in the latest e2fsprogs sources.  The WNOHANG was
introduced when I added support for the FSCK_MAX_INST environment
variable, which allows to user to constrain the maximum number of
child fsck's running at the same time, and FSCK_FORCE_ALL_PARALLEL.
What I needed to do was to call wait_one in blocking mode the first
time, and then call it in WNOHANG mode until all exited children have
been reaped.  This is necessary so that fsck will start keep the
necesary number of children in parallel at the same time.  What I did
instead was to always call it with WNOHANG always, which caused a
CPU-burning loop.  Oops.

Anyway, this will be fixed in the next release, which will be soon at
this point....

						- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-22  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-20 23:01 [PATCH][RFC] speeding up fsck -A Olaf Dietsche
2003-07-22  1:04 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).