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

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!boulder!hazelrah!drew
  3. From: drew@hazelrah.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Seagate scatter / gather patches
  5. Message-ID: <1993Jan28.000142.19523@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: hazelrah.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <vera.728038000@fanaraaken.Stanford.EDU> <1993Jan26.143815.2112@unislc.uucp>
  10. Date: Thu, 28 Jan 1993 00:01:42 GMT
  11. Lines: 234
  12.  
  13. Ok, here's the first installment of the Seagate patches,   This one 
  14. implements scatter-gather (I saw a 4X speed improvement).  As far 
  15. as CPU usage and "hanging" - things should improve if your filesystems
  16. aren't too fragmented.
  17.  
  18. Note that the current Seagate routines will not transfer >
  19. ~500-600K/sec. If your disk is faster than this, you'll have to 
  20. format at something greater than a 1:1 interleave if you want to 
  21. see the same four-fold performance increase.
  22.  
  23. I have another patch on the way that will allow the use of the 
  24. Seagate's hardware handshaking, it will be posted "RSN" (the 
  25. definition of RSN being somewhere between a few hours and six months).
  26. It should rectify the maximum transfer rate restriction.
  27.  
  28. Here are some figures for your perusal : 
  29.  
  30.  
  31. IOZONE results (using recommended file sizes, minix filesystems).
  32. To reduce buffer cache size (and therefore required filesize under 
  33. IOZONE), I loaded the memory by running X11R5 + 3 xterms + xman + xload + 
  34. xsysinfo + twm.
  35.  
  36. System : i386-33, 8M main memory, 64K cache
  37. SCSI host : Seagate ST02
  38. Software : Linux .99.3 
  39. Disk : /dev/sda3 Seagate 296N, 3:1 interleave
  40.  
  41. Writing the 3 Megabyte file, 'iozone.tmp'...50.610000 seconds
  42. Reading the file...62.110000 seconds
  43.  
  44. IOZONE performance measurements:
  45.         62156 bytes/second for writing the file
  46.         50647 bytes/second for reading the file
  47.  
  48. Software : Linux .99.4 + Seagate Scatter / Gather patches
  49. Disk : /dev/sda3 Seagate 296N, 3:1 interleave
  50.  
  51. Writing the 3 Megabyte file, 'iozone.tmp'...12.840000 seconds
  52. Reading the file...16.120000 seconds
  53.  
  54. IOZONE performance measurements:
  55.         244994 bytes/second for writing the file
  56.         195144 bytes/second for reading the file
  57.  
  58. And, as a baseline : 
  59.  
  60. Software : Linux .99.4 + Seagate Scatter / Gather patches
  61. Disk : /dev/hda2 Seagate 1144A 1:1 interleave
  62.  
  63. Writing the 3 Megabyte file, 'iozone.tmp'...7.500000 seconds
  64. Reading the file...15.520000 seconds
  65.  
  66. IOZONE performance measurements:
  67.         419430 bytes/second for writing the file
  68.         202688 bytes/second for reading the file
  69.  
  70. Software : Linux .99.3 
  71.  
  72. The patch : 
  73.  
  74.  
  75. *** 1.1    1993/01/27 20:33:13
  76. --- linux/kernel/blk_drv/scsi/seagate.c    1993/01/27 22:16:53
  77. ***************
  78. *** 225,230 ****
  79. --- 225,233 ----
  80.   
  81.   static unsigned char current_target, current_lun;
  82.   static unsigned char *current_cmnd, *current_data;
  83. + static int current_nobuffs;
  84. + static struct scatterlist *current_buffer;
  85.   static int current_bufflen;
  86.   static void (*done_fn)(Scsi_Cmnd *) = NULL;
  87.   static Scsi_Cmnd * SCint = NULL;
  88. ***************
  89. *** 353,358 ****
  90. --- 356,363 ----
  91.       {
  92.       int len;            
  93.       unsigned char *data;    
  94. +     struct scatterlist *buffer;
  95. +     int nobuffs;
  96.       int clock;            
  97.       int temp;
  98.       Scsi_Cmnd * SCtmp;
  99. ***************
  100. *** 371,379 ****
  101.       unsigned char message = 0;
  102.       register unsigned char status_read;
  103.   
  104. -     len=bufflen;
  105. -     data=(unsigned char *) buff;
  106.       incommand = 0;
  107.       st0x_aborted = 0;
  108.   
  109. --- 376,381 ----
  110. ***************
  111. *** 455,463 ****
  112.                   hostno, temp);
  113.               return (DID_BAD_INTR << 16);
  114.               }
  115. !                 data=current_data;      /* WDE add */
  116.                   cmnd=current_cmnd;      /* WDE add */
  117.                   len=current_bufflen;    /* WDE add */
  118.   
  119.   /*
  120.    *     We have determined that we have been selected.  At this point, 
  121. --- 457,468 ----
  122.                   hostno, temp);
  123.               return (DID_BAD_INTR << 16);
  124.               }
  125. !         buffer=current_buffer;    
  126.                   cmnd=current_cmnd;      /* WDE add */
  127. +                 data=current_data;      /* WDE add */
  128.                   len=current_bufflen;    /* WDE add */
  129. +         nobuffs=current_nobuffs;
  130.   
  131.   /*
  132.    *     We have determined that we have been selected.  At this point, 
  133. ***************
  134. *** 606,611 ****
  135. --- 611,629 ----
  136.                   }
  137.               return retcode(st0x_aborted);
  138.               }    
  139. + /* Establish current pointers.  Take into account scatter / gather */
  140. +         if ((nobuffs = SCint->use_sg)) {
  141. +                 buffer = (struct scatterlist *) SCint->buffer;
  142. +                 len = buffer->length;
  143. +                 data = (unsigned char *) buffer->address;
  144. +         } else {
  145. +                 buffer = NULL;
  146. +                 len = SCint->bufflen;
  147. +                 data = (unsigned char *) SCint->buffer;
  148. +         }
  149.           }
  150.   
  151.       CONTROL = BASE_CMD | CMD_DRVR_ENABLE | 
  152. ***************
  153. *** 748,753 ****
  154. --- 766,779 ----
  155.   /* clobbered */
  156.   "ebx", "ecx", "edi", "esi"); 
  157.   
  158. +                         if (!len && nobuffs) {
  159. +                                 --nobuffs;
  160. +                                 ++buffer;
  161. +                                 len = buffer->length;
  162. +                                 data = (unsigned char *) buffer->address;
  163. +                         }
  164.               break;
  165.   
  166.           case REQ_DATAIN : 
  167. ***************
  168. *** 811,816 ****
  169. --- 837,850 ----
  170.   "0" (data), "1" (len) :
  171.   /* clobbered */
  172.   "ebx", "ecx", "edi", "esi"); 
  173. +                         if (!len && nobuffs) {
  174. +                                 --nobuffs;
  175. +                                 ++buffer;
  176. +                                 len = buffer->length;
  177. +                                 data = (unsigned char *) buffer->address;
  178. +                         }
  179.               break;
  180.   
  181.           case REQ_CMDOUT : 
  182. ***************
  183. *** 858,864 ****
  184. --- 892,901 ----
  185.               case DISCONNECT :
  186.                   should_reconnect = 1;
  187.                                   current_data = data;    /* WDE add */
  188. +                 current_buffer = buffer;
  189.                                   current_bufflen = len;  /* WDE add */
  190. +                 current_nobuffs = nobuffs;
  191.   #if (DEBUG & (PHASE_RESELECT | PHASE_MSGIN))
  192.                   printk("scsi%d : disconnected.\n", hostno);
  193.                   done=1;
  194. ***************
  195. *** 877,891 ****
  196.                   done=1;
  197.                   break;
  198.               case SAVE_POINTERS :
  199. !                 current_data = data;    /* WDE mod */
  200.                                   current_bufflen = len;  /* WDE add */
  201.   #if (DEBUG & PHASE_MSGIN)
  202.                   printk("scsi%d : pointers saved.\n", hostno);
  203.   #endif 
  204.                   break;
  205.               case RESTORE_POINTERS:
  206. !                 data=current_data;    /* WDE mod */
  207.                   cmnd=current_cmnd;
  208.   #if (DEBUG & PHASE_MSGIN)
  209.                   printk("scsi%d : pointers restored.\n", hostno);
  210.   #endif
  211. --- 914,933 ----
  212.                   done=1;
  213.                   break;
  214.               case SAVE_POINTERS :
  215. !                 current_buffer = buffer;
  216.                                   current_bufflen = len;  /* WDE add */
  217. +                 current_data = data;    /* WDE mod */
  218. +                 current_nobuffs = nobuffs;
  219.   #if (DEBUG & PHASE_MSGIN)
  220.                   printk("scsi%d : pointers saved.\n", hostno);
  221.   #endif 
  222.                   break;
  223.               case RESTORE_POINTERS:
  224. !                 buffer=current_buffer;
  225.                   cmnd=current_cmnd;
  226. +                 data=current_data;    /* WDE mod */
  227. +                 len=current_bufflen;
  228. +                 nobuffs=current_nobuffs;
  229.   #if (DEBUG & PHASE_MSGIN)
  230.                   printk("scsi%d : pointers restored.\n", hostno);
  231.   #endif
  232. -- 
  233. Boycott AT&T for their absurd anti-BSDI lawsuit. | Drew Eckhardt
  234. Condemn Colorado for Amendment Two.         | drew@cs.colorado.edu
  235. Use Linux, the fast, flexible, and free 386 unix |  
  236.