public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* One more bio for for floppy users in 2.5.33..
@ 2002-09-03 18:00 Linus Torvalds
  2002-09-03 18:02 ` Jens Axboe
  2002-09-03 20:57 ` Mikael Pettersson
  0 siblings, 2 replies; 30+ messages in thread
From: Linus Torvalds @ 2002-09-03 18:00 UTC (permalink / raw)
  To: Kernel Mailing List; +Cc: Jens Axboe


Ok,
 I found another major bio-related bug that definitely explains why the 
floppy driver generated corruption - any partial request completion would 
be totally messed up by the BIO layer (not the floppy driver).

Any other block device driver that did partial request completion might 
also be impacted.

I'm still looking at the floppy driver itself - some of the request 
completion code is so messed up as to be unreadable, and some of that may 
actually be due to trying to work around the bio problem (unsuccessfully, 
I may add). So this may not actually fix things for you yet, simply 
because the floppy driver itself still does some strange things. 

Jens, oops. We should not update the counts by how much was left
uncompleted, but by how much we successfully completed!

		Linus

----
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/03	torvalds@home.transmeta.com	1.582
# Major partial request completion boo-boo in the bio layer.
# 
# This was _bad_. Major floppy corruption, and possibly the reason
# for other block device corruption for any driver that generated
# partial results for a block device request.
# --------------------------------------------
#
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c	Tue Sep  3 10:53:59 2002
+++ b/drivers/block/ll_rw_blk.c	Tue Sep  3 10:53:59 2002
@@ -1992,11 +1992,11 @@
 		 * not a complete bvec done
 		 */
 		if (unlikely(nsect > nr_sectors)) {
-			int residual = (nsect - nr_sectors) << 9;
+			int partial = nr_sectors << 9;
 
-			bio->bi_size -= residual;
-			bio_iovec(bio)->bv_offset += residual;
-			bio_iovec(bio)->bv_len -= residual;
+			bio->bi_size -= partial;
+			bio_iovec(bio)->bv_offset += partial;
+			bio_iovec(bio)->bv_len -= partial;
 			blk_recalc_rq_sectors(req, nr_sectors);
 			blk_recalc_rq_segments(req);
 			return 1;


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: One more bio for for floppy users in 2.5.33..
@ 2002-09-07 14:43 linux
  0 siblings, 0 replies; 30+ messages in thread
From: linux @ 2002-09-07 14:43 UTC (permalink / raw)
  To: linux-kernel

On Fri, 6 Sep 2002, Linus Torvalds wrote:
> Note that the delay for motor on/off is _much_ larger than the actual 
> delay for seeking.
> 
> The seek itself is on the order of a few ms, with the head settle time 
> being in the tens (possibly even a few hundred) ms per track. So assuming 
> you end up reading 4 tracks or so due to readahead, that's still in the 
> range of about one second.
> 
> In contrast, the motor on/off time is something like 5 seconds if I
> remember correctly. Of course, you can certainly eject the floppy while
> the motor is still running, but I'd suggest against it.

You're forgetting the transfer rate.  A 1440K floppy has 160
tracks (80 cylinders * 2 heads), or 9K per track.

It spins at 300 RPM, so it takes at least 200 ms to read that track.
45K/sec.

A 64K read spans 7.11 tracks, which will take 1422 ms to read.
Add 100 ms for initial rotational latency, and assume that subsequent
tracks are optimally arranged for continuous reads.

That's 1.5 secods just to transfer the data.

*Then* you can add all of the seek and motor spin-up/down times
mentioned above.

(Of course, if the floppy *isn't* formatted optimally, add an
extra 100 ms per seek, or 700 ms total, of rotatinal latency.)

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

end of thread, other threads:[~2002-09-10  7:41 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-03 18:00 One more bio for for floppy users in 2.5.33 Linus Torvalds
2002-09-03 18:02 ` Jens Axboe
2002-09-04  7:25   ` Suparna Bhattacharya
2002-09-04 16:36     ` Linus Torvalds
2002-09-05  7:03       ` Suparna Bhattacharya
2002-09-05 15:06         ` Linus Torvalds
2002-09-05 16:26           ` Andrew Morton
2002-09-05 17:05             ` Linus Torvalds
2002-09-05 18:00               ` Andrew Morton
2002-09-05 18:28                 ` Linus Torvalds
2002-09-05 18:31                   ` Jens Axboe
2002-09-05 18:38                     ` Linus Torvalds
2002-09-05 18:38                       ` Jens Axboe
2002-09-05 19:47                         ` Peter Osterlund
2002-09-05 18:42                   ` Andrew Morton
2002-09-05 19:03                     ` Linus Torvalds
2002-09-05 19:35                       ` Andrew Morton
2002-09-05 20:27                         ` Linus Torvalds
2002-09-05 20:38                           ` Linus Torvalds
2002-09-06  6:47                           ` Helge Hafting
2002-09-06  6:59                             ` Linus Torvalds
2002-09-09 14:08                               ` Bob_Tracy
2002-09-05 20:48                         ` Linus Torvalds
2002-09-10  7:25                       ` Rogier Wolff
2002-09-10  8:01                         ` Andrew Morton
2002-09-07 11:18                     ` Daniel Phillips
2002-09-03 20:57 ` Mikael Pettersson
2002-09-03 21:52   ` Linus Torvalds
2002-09-03 22:33     ` Mikael Pettersson
  -- strict thread matches above, loose matches on Subject: below --
2002-09-07 14:43 linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox