home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8004 < prev    next >
Encoding:
Text File  |  1992-08-12  |  6.1 KB  |  195 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!gatech!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!news.th-darmstadt.de!hp11.iti.informatik.th-darmstadt.de!herr
  3. From: herr@hp11.iti.informatik.th-darmstadt.de (Gabor Herr)
  4. Subject: AMD386 vs. Intel386 & external cache problems
  5. Message-ID: <1992Aug12.153149.29972@news.th-darmstadt.de>
  6. Sender: herr@iti.informatik.th-darmstadt.de (Gabor Herr)
  7. Date: Wed, 12 Aug 1992 15:31:49 GMT
  8. Nntp-Posting-Host: hp11.iti.informatik.th-darmstadt.de
  9. Organization: TU Darmstadt
  10. Keywords: AMD 386 Intel cache
  11. Lines: 182
  12.  
  13. Hello Linuxers,
  14.  
  15. two weeks ago I posted to this newsgroup, that I had problems with my new 386
  16. motherboard (AMD386, 40MHz, ETEQ Cougar chipset, 64KB cache, 8MB memory).
  17. Running Linux on it, from time to time some processes or even
  18. the kernel died with a signal SIGSEGV, which was caused by a `general protection
  19. error'. After turning off the onboard external cache everything worked
  20. fine. 
  21.  
  22. To localize the error and make it reproducible I tested the machine
  23. with the following two endless loops under Linux 0.96cp2: 
  24.  
  25. in VT1 a kernel compiling:
  26.  
  27. $ cd /usr/src/linux
  28. $ while true; do make clean; make Image; done
  29.  
  30. in VT2 formatting of a manpage
  31.  
  32. $ while true; do groff -Tps -e -t -man bash.1 > bash.ps; done
  33.  
  34. With cacheing enabled either gcc or groff or the kernel died with a SIGSEGV
  35. within a half an hour. I considered a configuration as working if the
  36. loops ran at least one hour.
  37.  
  38. As I already mentioned in the first posting I exchanged my board for an
  39. other one with 33MHz (AMD386, 33MHz, C&T Peak chipset, 64KB cache),
  40. because one of my frieds had a similar machine, where Linux was running
  41. without any problems (he tried the above test). The only difference between
  42. the two boards: different manufacturer and his had an Intel 386 processor
  43. on it. After installing the new board I was quite amazed as I got exactly
  44. the same errors as before.
  45.  
  46. To narrow down the problem we begun to exchange the other components
  47. of his and my machine. Finally we could reproduce the errors with my
  48. board in his machine whereas his board with my IO cards worked
  49. correctly. 
  50.  
  51. The second approach was to test the board's external cache memory. I wrote the
  52. two test programs below cachetest and memtest. The first one reads and writes a
  53. small data area (1-64KB) which completly fits into the cache and checks its
  54. consistency. The latter does the same on a bigger area (ca. 1-8MB),
  55. causing the cache always to be reloaded. I got following results:
  56.  
  57. cachetest 1000        ran 3 hours without error (buffer 1000 Bytes)
  58. memtest    1100        did 2000 cycles (1 hour) without error (buffer 4.4MB) 
  59. memtest 3000        did 22 cycles  (1 hour) without errors (buffer 12MB)
  60.  
  61. memtest 1000 &
  62. memtest 1000        (the two programs parallel) ran 1 hour, then
  63.             the first exited with a SIGSEGV
  64.  
  65. The tests show that this *cannot* be a cache problem. In the last case
  66. memtest died because of a memory error in the code segment, which is
  67. about 17k big. The probability for a `failed assertion' in 4-12 MB data
  68. area would be much higher in case of a bad cache. It also cannot be a
  69. HD problem: the second and the third test made Linux swap a lot (the
  70. third one even caused tharshing, so I had to stop one of the processes and
  71. let it continue later...). I never saw those `HD timeout errors' or
  72. `unexpected HD interrupt's described in many postings.
  73.  
  74. As a last try I went back to my dealer and after he made me a good
  75. price, I changed the board for an Intel 486DX, 33Mhz, 256KB cache, 
  76. C&T Peak chipset. And now Linux works fine on this even much faster
  77. machine. I stopped the gcc/groff test after 4 hours of running without
  78. any errors.:-)
  79.  
  80. My problem is solved, but there could be somebody out in the net
  81. despaired of those intermitting SIGSEGV`s (I can feel with him ;-)),
  82. whom my experiences probably will help. 
  83.  
  84. I also want to know what was the reason for this kind of errors.
  85. Therefore some questions:
  86.  
  87. - Is there anybody out in the net using Linux on a configuration
  88.   similar to my old one? Please try to run the above tests and tell me
  89.   if it worked...
  90.  
  91. - Are there differences between AMD 386 and Intel 386? Has the AMD
  92.   probably some bugs?
  93.  
  94. Thanx...
  95.  
  96. Gabor
  97.  
  98.  
  99. ############################################################################
  100. Gabor Herr            Email: herr@iti.informatik.th-darmstadt.de
  101. Computer Science Department
  102. Technical University of Darmstadt, Germany
  103.  
  104.  
  105. PS: just for info, my other machine components:
  106.  
  107. HD:    Seagate ST3144A, IDE, 124MB
  108. VGA:    ColorIMAGE, ET4000, 1MB
  109. Memory:    8MB, as 8x1MB SIMMS
  110. Serial:    noname MultiIO Card (not used in most of the tests)
  111.  
  112.  
  113. ----------------------------- cut here ---------------------------------------
  114. /* 
  115.  * cachetest.c        Test onboard external cache
  116.  *
  117.  * usage: cachetest <n>    
  118.  *        <n> buffer size in bytes
  119.  */
  120.  
  121. #include <stdio.h>
  122. #include <assert.h>
  123.  
  124. #define MAXBUFFER    4096
  125.  
  126. main( argc, argv )
  127. int argc;
  128. char **argv;
  129. {
  130.   static unsigned int buffer[MAXBUFFER];
  131.  
  132.   unsigned i;
  133.   unsigned n;
  134.   unsigned cycle;
  135.  
  136.   n = atoi( argv[1] );
  137.  
  138.   printf("Testing cache, buffer size is %d...\n",n);
  139.  
  140.   for ( i = 0; i < n; i++ )
  141.     buffer[i] = 0;
  142.  
  143.    for ( cycle = 0; ; cycle++ ) {
  144.      for ( i = 0; i < n; i++ ) {
  145.        assert( buffer[i] == cycle );
  146.        (buffer[i])++;
  147.      }
  148. /*     if ( cycle % 1000 == 0 ) printf("%d\n",cycle); */
  149.    }
  150. }
  151.  
  152. ----------------------------- cut here --------------------------------------
  153. /* 
  154.  * memtest.c        Test onboard external cache
  155.  *
  156.  * usage: memtest <n>    
  157.  *        <n> buffer size in KWords
  158.  */
  159.  
  160.  
  161. #include <stdio.h>
  162. #include <assert.h>
  163. #include <stdlib.h>
  164.  
  165. main( int argc, char **argv )
  166. {
  167.   unsigned *memstart, *memend, *addr, offset;
  168.   int kws;
  169.  
  170.   kws = atoi(argv[1]);
  171.  
  172.   fprintf( stderr, "Testing %d KWord system memory...\n", kws);
  173.  
  174.   if ((memstart = (char *) malloc( kws * 1024 * 4)) == NULL) {
  175.     fprintf(stderr, "out of memory\n");
  176.     exit(1);
  177.   }
  178.  
  179.   memend = memstart + kws * 1024;
  180.   
  181.   for ( addr = memstart; addr < memend; addr++ )
  182.     *addr = addr;
  183.  
  184.   for ( offset = 0; ; offset++ ) {
  185.     fprintf(stderr,"memtest: offset = %d\n",offset);  
  186.     for ( addr = memstart; addr < memend; addr++ ) {
  187.       assert(*addr == (unsigned)addr + offset);
  188.       (*addr)++;
  189.     }
  190.   } 
  191. }
  192.  
  193. ----------------------------------- cut here ---------------------------------
  194.  
  195.