From owner-freebsd-fs Wed Dec 26 11:15:17 2001 Delivered-To: freebsd-fs@freebsd.org Received: from hawk.prod.itd.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id 3FB7437B416; Wed, 26 Dec 2001 11:15:14 -0800 (PST) Received: from 1cust25.tnt2.ogden.ut.da.uu.net ([63.39.41.25] helo=mindspring.com) by hawk.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16JJW4-0001mn-00; Wed, 26 Dec 2001 11:15:04 -0800 Message-ID: <3C2A21B9.428C3800@mindspring.com> Date: Wed, 26 Dec 2001 11:15:05 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Alfred Perlstein Cc: Ian Dowse , mckusick@freebsd.org, fs@freebsd.org Subject: Re: fsck and predictive readahead? References: <20011222053306.Y48837@elvis.mu.org> <200112221353.aa41047@salmon.maths.tcd.ie> <20011222150814.Z48837@elvis.mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Alfred Perlstein wrote: > ./fsck_ffs -d -n /vol/spare 24.50s user 4.72s system 19% cpu 2:30.73 total > > No matter how you order the IO, fsck is going to have to wait for read(2) > to return. If we can offload that waiting to a child process we may > be able to fix this. > > Is there any detailed commenting on the sources available, they are > quite readable, but still very terse. A more in depth explanation > of each function would really help. Do you know of a paper, manpage > or do you have the time to sprinkle some commentary into the code? There's a paper on fsck in /usr/share, and it's also in the Usenix published books (I can share them with you, if you need me to). The easiest way to handle this would be with a windowed mmap(), with the other process being given either atonomy to read one byte per page, predictively, or the calculation ahead. Then the pages would be in core by the time the first process needed them, and then all we are talking about is mapping. This really looks like a job for rfork(), rather than another process, or true threads, so that the address space is shared, and there is not a remapping requirement (PTE thrashing would potentially slow you down with any other approach). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message