Re: Linux 2.4.x block device driver question

From: Jonathan Corbet (
Date: Mon Jun 02 2003 - 08:52:28 EST

> I was trying to see how __make_request throttles a fast writing process
> from overrunning a slow device. So I took Alessandro Rubini's spull.c
> code from his device driver book (2nd edition)

Alessandro's...and that other guy's...:)

> dd if=/dev/zero of=/dev/pda bs=1024 count=1000000
> What I expect is that the kernel will quickly stop dd after all 128 (64
> on machines with less than 32MB of ram) free request slots are taken.

As you noted, that didn't happen. My guess is you ran out of memory. The
requests you are generating will be, shall we say, easily merged in the
block subsystem. So you have a bunch of requests in the device's queue,
but each one will have a long chain of buffer heads hanging off it. You
may not have even managed to use up all the available request structures
before things came to a halt. Try dropping the max_sectors[] count way
down, and things might work a little better. After your fsck completes,
that is.


Jonathan Corbet
Executive editor,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:16 EST