Re: pre-31-7 does badblocks better than -6

kwrohrer@enteract.com
Wed, 20 Aug 1997 06:16:45 -0500 (CDT)


And lo, Rogier Wolff saith unto me:
> Doug Ledford wrote:
> > On Mon, 18 Aug 1997, Pete Harlan wrote:
> > > FYI,
> > > pre-patch-2.0.31-7 had no problems doing badblocks, while
> > > pre-patch-2.0.31-6 produced "Couldn't get a free page" and was
> > > unreachable over the network (no response to pings) for 10-20 sec.
> > >
> > > Interactive performance was sluggish throughout badblocks run with
> > > either kernel.
> >
> > FWIW, people should probably be aware that almost no system in the world
> > will *not* be sluggish suring a badblocks run simply because the drive bus
> > is being nailed so hard that interactive work has to wait its turn in line
> > to get drive requests out the queue (which will be a rather large queue
> > when doing a badblocks -w).
> When, just like with CPU scheduling, the kernel would prefer giving a
> slot to an interactive process instead of the disk-hogging process, it
> would be less of a problem.
That's fine in theory; but just how should the kernel determine if
something is "interactive"? I/O bound vs. CPU bound is easy enough,
but just what counts (and doesn't count) as a source of interaction,
especially with X involved, especially as the determination must be
done at the kernel level? How do you tell a mouse from a modem, remote
X events or telnet characters from a file coming back from an ftpd,
outgoing ftp data from outgoing streaming video?

> This is why deep tagged-queues are a bad idea.
Any queue ordering scheme will be at most as fair as FIFO, true, and
the deeper the queue is allowed to get the less fair it may become...

> When implemented correctly, as soon as there is contention for a
> resource like a disk, the kernel should prevent the process that is
> monopolizing the resource from using all the bandwidth. This could be
> accomplished by inserting an extra delay on, in this case, writing
> another block. Yes, this will mean that the disk starts to be idle
> some of the time. This is exactly what you want. My guess is that this
> algorithm should try to keep the disk idle for about 10% of the time.
Okay, so a busy nntpd should be denied the full bandwidth of the news
spool because root might log on some year and be impatient with a slow
response to "ls"? This is silly...especially in the case where the queue
depth is 0 and the putative hog is made to wait anyway. Unless the
hog is using async I/O or batching up a lot of writes, you're not going
to be able to notice a hog easily anyway without establishing histories...
and I'd much rather use that memory for write buffers.

Most disks, last I heard, prioritize reads over writes; if the kernel
did the same (or downprioritized just the buffered writes), interactive
performance should be just fine because either the interactive interloper
is doing a read or a synchronous write (in which case it gets handled
at least fairly quickly), or it's doing a bufferable write (which will
get buffered and allow the syscall to return immediately). All it
needs is a little aging mechanism to make sure old writes get presented
to the disk sometime this month.

Keith