home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / protocol / nfs / 1962 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  4.6 KB

  1. Path: sparky!uunet!olivea!sgigate!odin!sgi!rhyolite!vjs
  2. From: vjs@rhyolite.wpd.sgi.com (Vernon Schryver)
  3. Newsgroups: comp.protocols.nfs
  4. Subject: Re: NFS I/O Ops/seconds
  5. Message-ID: <nr9dafk@rhyolite.wpd.sgi.com>
  6. Date: 27 Jul 92 23:20:52 GMT
  7. References: <1992Jul22.061146.15641@u.washington.edu> <numb.711969731@root.co.uk> <JIM.92Jul27180010@hunter.cs.strath.ac.uk>
  8. Organization: Silicon Graphics, Inc.  Mountain View, CA
  9. Lines: 85
  10.  
  11. In article <JIM.92Jul27180010@hunter.cs.strath.ac.uk>, jim@cs.strath.ac.uk (Jim Reid) writes:
  12. > Well, considering that I plucked the number out of thin air, this is
  13. > probably not surprising. Maybe your implementation takes more (or
  14. > less) instructions. However, it should take around 1000 instructions
  15. > or so for the typical RISC chip to take an NFS request off the network
  16. > interface hand it off to the NFS code (or push a reply back out). Even
  17. > if the number was twice that amount, it would still be dwarfed by the
  18. > CPU cycles needed to actually *do* the NFS request. And if there was a
  19. > disk I/O (~10ms), a factor of 100 on the number of instructions, could
  20. > be included without much trouble.
  21.  
  22. Why should it take vastly more than 1000 cycles for the server to
  23. handle a read or write request?  It is easier to look through the disk
  24. cache, allocate a buffer, add it to the controller's queue, take the
  25. interrupt, call iodone(), and so on than it is to do the equivalent for
  26. an ethernet or FDDI packet.  Disks are dirt simple and easy.
  27.  
  28. You can't count queue-wait-time as the system runs the null jub,
  29. because the server should be expected to have more than one spindle on
  30. which to spend CPU cycles.  And there are all of those lookup's and
  31. getattr's on which to spend CPU cycles.
  32.  
  33. I don't know how many cycles the "typical RISC chip" requires to
  34. "actually *do" the NFS request," but people here have spent some little
  35. time discovering how many are required on R3K's.
  36.  
  37. >    If 
  38. >     -your system uses 4KByte pages, 
  39. >     -if your NFS implementation happens to use 4K blocks,
  40. >     -if your file system happens to like to use 4K buffers,
  41. >    and  -if your FDDI hardware handles UDP checksums,
  42. >    then you can avoid around 1024 cache-missing loads and stores by using
  43. >    "page flipping".  That is the equivalent of 10,000 to 100,000
  44. >    instructions per packet.  (The cache miss penalty for an R4K at
  45. >    50/100MHz is awesome.)
  46. > True. Can the SGI kernel really be so dumb as to take loads of cache
  47. > misses when computing UDP checksums? If so, we all know what machines
  48. > don't make good NFS servers...
  49.  
  50. Are you a student?  Do you understand how CPU caches work?
  51.  
  52. It is simply impossible to avoid cache misses when computing the UDP
  53. checksum on an incoming packet.  Remember that by definition the
  54. contents of the packet are not in the cache; they just came off the
  55. wire or the disk.  If they are in your cache, you either have an I/O-
  56. coherent cache (e.g. all current Silicon Graphics multiprocsors) or you
  57. have an incredibly stupid, Intel-386 style network or disk driver.
  58.  
  59. In some systems you can bypass the caches.  Today that is generally a
  60. mistake because a non-cached access costs the same as a cached access
  61. and does not get the advantage of cache-burst-fill which makes some
  62. subsequent accesses cache-hits.  On the other hand, by bypassing the
  63. cache and paying the extra cycles, you do avoid trashing the data
  64. cache.  Read a recent, nice summary of this point as it applies to
  65. bcopy() and bzero() in comp.arch.
  66.  
  67. Then there is the problem of multi-level caches.  Some current SGI
  68. machines have a MByte or more  of secondary cache, but only a few K of
  69. on-chip cache.  There is simply no way you can avoid primary cache
  70. misses with a small on-chip cache.  And the same considerations for
  71. burst-mode apply to using non-cached accesses.
  72.  
  73. SGI's raw TCP or UDP FDDI speed is not bad, in part because the network
  74. hardware can do the UDP checksum.  If you also avoid the bcopy(),
  75. the data never sees the CPU and so cannot cause any cache misses.
  76.  
  77. >    I also don't think saving 1000 instructions is anything to sneeze at.
  78. >    Saving 1000 instructions would produce a large speed up in SGI NFS
  79. >    server.  (We don't yet page-flip.)  Also, remember that 1000
  80. >    instructions is not necessarly even close to 30 usec even at 33 MHz,
  81. >    unless your primary instruction cache is very large.
  82. > Hmmm. How big are your instructions? Let's say they are 64 bits long
  83. > (or wide). 1000 of them will fit in 8K. This is not large for a cache
  84. > these days.
  85.  
  86. I don't know of a current system with instructions generally 64 bits wide.
  87. The current crop of "64-bit" systems use 32-bit wide instructions.
  88.  
  89. 8K is not too small for an on-chip cache.
  90. 100MHz is fast for an off-chip cache.
  91.  
  92.  
  93. Vernon Schryver,  vjs@sgi.com
  94.