Subject: Re: processes consuming all CPU during I/O on LFS
To: Blair Sadewitz <>
From: Thor Lancelot Simon <>
List: current-users
Date: 11/16/2006 15:58:57
On Thu, Nov 16, 2006 at 03:28:29PM -0500, Blair Sadewitz wrote:
> I've noticed that if I untar a lot of files on an LFS filesystem,
> toward the very end of the untar (when all files in the archive are
> listed with -v but before it finishes), tar consumes 95%+ CPU for a
> few minutes and things get VERY slow.  This does not happen on FFS
> filesystems.  Is this just the nature of LFS, a bug, or do I have
> something set up incorrectly?  I got my lfs bsize from the -A option
> (2949k).

It's a problem with the code that flushes pending writes.  Your system
has a lot of free RAM, I expect.

If you look at the I/O statistics for that disk using "systat vmstat"
or iostat while the system is being slow, how many megs/sec is it
writing?  You could try this:

1) Take a rough estimate of your disk's write bandwidth in bytes/sec.
   Let's say it's 30000000.

2) Divide this by 4096 (on i386) to get pages, 7324 in this case.

3) Divide this by 4, a fudge factor chosen by means I can't explain
   well in a short email message, yielding 1831.

4) Check that 1831 * 4096 is larger than your segment size.  Since it's
   about 7.5MB, you're safe.

5) sysctl -w vfs.lfs.pagetrip=1831

Let me know what the results look like.

Thor Lancelot Simon	                           
  "The liberties...lose much of their value whenever those who have greater
   private means are permitted to use their advantages to control the course
   of public debate."					-John Rawls