home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / linux / 25550 < prev    next >
Encoding:
Text File  |  1993-01-27  |  6.1 KB  |  145 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!boulder!romeo!drew
  3. From: drew@romeo.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Re: Bernoulli/SyQuest
  5. Message-ID: <1993Jan27.011248.8864@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: romeo.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <727748701.AA34908@remote.halcyon.com> <C1FCLA.1vFD@austin.ibm.com>
  10. Date: Wed, 27 Jan 1993 01:12:48 GMT
  11. Lines: 132
  12.  
  13. In article <C1FCLA.1vFD@austin.ibm.com> jstump@auntbea.austin.ibm.com (John E. Stump) writes:
  14. >In article <727748701.AA34908@remote.halcyon.com> Chris.Bugosh@f340.n226.z1.fidonet.org (Chris Bugosh) writes:
  15. >>Can I have some horror/success stories on setting up Linux on either of
  16. >>these two boxes?  I'd also know what controller you're using...  I hear
  17. >>that the controller that comes with the Bernoulli from Hard Drives
  18. >>International doesn't work.  Is the adapter that comes with the SyQuest
  19. >>compatible?  Thanks for any/all info.
  20. >>
  21. >>Chris
  22. >>
  23. >> * Origin: The MIDI Exchange - Columbus, Ohio - (614) 846-1274
  24. >>(1:226/340)
  25. >>
  26. >
  27. >I have a SyQuest 44MB attached to a Seagate ST-01 SCSI card in my 486DX
  28. >clone. Up until Linux 0.99pl4, it would not allow me to do any writes to
  29. >the disk without crashing. Now it works, except for a few spurious error
  30. >messages that I believe are harmless.
  31. >
  32. >There are a couple of weaknesses in it though: (1) when a rather large
  33. >buffer cache is being flushed to the Syquest, interrupts are turned off
  34. >and the system in literally locked up until the write is done (which is
  35. >slow since this is a Syquest), and 
  36.  
  37. Technically, this statement is invalid.  Interrupts are enabled 
  38. in the Seagate driver, and I/O to other disks, serial / ether ports,
  39. etc will continue uninterupted.
  40.  
  41. However with an unbuffered disk, user processes will not be run for an 
  42. unbearably long time.
  43.  
  44. With an IDE setup, we only need to hang around in kernel
  45. code, not running user processes, when we are actually sending data
  46. to the disk as fast as we can, spending all of our time waiting 
  47. for rotational latency and seek time running user code.
  48.  
  49. With the Seagate / unbuffered SCSI, things are a little more involved.
  50. After issuing the SCSI command (Involving ARBITRATION for the SCSI bus, a 
  51. MESSAGE phase and COMMAND phase), the disk may DISCONNECT if it needs 
  52. to seek.  User processes will run during this time, probably ~8-
  53. ~30ms. If we did DISCONNECT, we have to go through RESELECTION, 
  54. and MESSAGE phases.  Finally, we can start transfering data AS DICTATED 
  55. BY THE DRIVE.
  56.  
  57. An unbuffered disk will force us to twiddle our thumbs in kernel mode,
  58. with no user processes running, until our sector becomes available.  This 
  59. will be the rotational latency of the disk, ~8ms average, ~16ms worst
  60. case on a 3600 RPM disk.  Due to the high-overhead of the SCSI protocol,
  61. we can't stream the disk reading a SINGLE block per SCSI command.  So, 
  62. for every block on a track after the first one (many SCSI disks have 
  63. 60 sectors, or 30 blocks on a track, which means nearly .5 seconds), we waste 
  64. our worst case rotational delay of ~16ms in kernel code.  With only 50K of 
  65. dirty blocks in the cache, user processes may be suspended for nearly a 
  66. second, running only during those ~8-~30ms periods when the drive is doing a 
  67. long seek (Should be infrequent, since ideally files are allocated 
  68. contiguously, and the requests have been sorted to minimize head movement).
  69.  
  70. Like I said, this is what happens using a SINGLE block per command.
  71. Scatter-gather solves this problem, by allowing us to read/write all 
  72. contiguous blocks on a disk to non contiguous buffers.  
  73.  
  74. Another problem is in how commands were being propogated to the lowlevel
  75. SCSI drivers.  Basically, it looked like this 
  76.  
  77. disk driver translates request to SCSI command
  78. mid level passes command to Seagate driver 
  79. seagate drive issues command to disk
  80. command completes, callback to midlevel
  81. midlevel callback to disk driver 
  82.  
  83. From within the callback, the next command is propogated in the 
  84. same way back to the Seagate driver.  Real painful.
  85.  
  86. This destroys our chances of getting a command to the disk in time 
  87. for non-contigous sectors on the same track.
  88.  
  89. The solution is to overlap things somewhat, having the disk driver
  90. issue a large number of commands at once, so it looks like 
  91.  
  92. disk driver translates requests to SCSI commands
  93. midlevel passes commands to Seagate driver
  94.  
  95. issue command
  96. command completes
  97. issue next command 
  98. call backs
  99. command completes
  100.  
  101. and so on.  
  102.  
  103. The code for multiple outstanding commands per LUN makes this 
  104. possible.  
  105.  
  106. All of the high and midlevel code is there, thanks to Eric.  The code
  107. in the Seagate driver has also been written, but not yet integrated 
  108. because I was having problems with the stack overflow problem that 
  109. Eric traced down (Didn't know it at the time.  It's blazingly fast
  110. compared to the current code, will stream a 34 sector / track
  111. drive interleved aat 3:1, but was a trifle unstable).
  112.  
  113. Another note : 
  114.  
  115. The current hand-coded assembler loop in the Seagate routines transfers 
  116. at ~500K/sec  (I think wde verified this with a scope),  but you can 
  117. go much faster if you let the seagate use the SCSI bus handshake signals
  118. to generate wait states as needed with the 0ws jumper and just dump
  119. data down it's throat.  
  120.  
  121. The code for this is also done, but unintegrated / tested.
  122.  
  123. As far as the seagate performance improvements becoming publically available :
  124. "RSN" (which means an arbitary time somehwhere between a few hours and six 
  125. months) if I do it some other time frame (hint hint) if some one wants to 
  126. borrow my code and / or do it themselves.
  127.  
  128. Another note : 
  129.  
  130. You may be happier if you discover the optimal interleave and format your 
  131. cartridges at something less than 1:1.
  132.  
  133. >(2) although the Syquest is a
  134. >"mountable" hard disk, the partition table on the cartridge is only
  135. >read once during boot up, so you are out of luck if you want to umount
  136. >and mount a different cartridge while the system is up and running.
  137.  
  138. Nope, you can change cartridges.  Sending a BLKRRPART ioctl to the disk will 
  139. reread the partition table.  
  140.  
  141. -- 
  142. Boycott AT&T for their absurd anti-BSDI lawsuit. | Drew Eckhardt
  143. Condemn Colorado for Amendment Two.         | drew@cs.colorado.edu
  144. Use Linux, the fast, flexible, and free 386 unix |  
  145.