home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mips / 1063 < prev    next >
Encoding:
Text File  |  1992-11-22  |  2.5 KB  |  63 lines

  1. Newsgroups: comp.sys.mips
  2. Path: sparky!uunet!munnari.oz.au!metro!basser.cs.su.oz.au!swift!suite.sw.oz.au!chris
  3. From: chris@suite.sw.oz.au (Chris Maltby)
  4. Subject: Select snafu on Riscos 4.52 - a fix?
  5. Organization: Softway Pty Ltd
  6. Date: 23 Nov 92 00:51:44 GMT
  7. Message-ID: <chris.722479904@suite.sw.oz.au>
  8. Sender: news@softway.sw.oz.au (Usenet)
  9. Lines: 52
  10.  
  11. We have an interesting problem with select and stream events on
  12. our 4.52 3230 system(s). Strangely, one exhibits the problem worse
  13. than the other, though we haven't yet worked out why. The problem
  14. is this: sometimes select will return EAGAIN (though this is not
  15. a documented return). Programs like xterm will consider this to
  16. be a fatal error and exit.
  17.  
  18. We have tracked the problem to be excessive consumption of stream
  19. event structures, but worse, the consumption is mostly redundant.
  20. Here is a piece of crash output:
  21.  
  22. : :q29; crash
  23. dumpfile = /dev/mem, namelist = /unix, outfile = stdout
  24. reading symboltable................................................................................
  25. > stream -ef !uniq -c
  26.    1 ADDR      WRQ     IOCB VNODE     PGRP    IOCID   IOCWT WOFF ERR FLAG
  27.    1 c019f000 c01a13f4    - c01a0744 17572      32710     0    0   0 nbio 
  28.    1      STRTAB  RCNT
  29.    1     801085f4    0
  30.    1     SIGFLAGS:  
  31.    1     SIGLIST:
  32.    1     POLLFLAGS:   in
  33.    1     POLLIST:
  34.  135         PROC:  190    in
  35.    1 
  36. ...
  37.  
  38. and there are lots more streams in similar states. The processes seem
  39. to be selecting without timeouts, and they accumulate stream events as
  40. time goes by. In fact, we believe that each such stream acquires a new
  41. event structure every time nselcoll occurs, though nselcoll may occur
  42. as a result of the bogus event list. The structures are eventually freed
  43. when the select returns.
  44.  
  45. This problem exposed another in the way stream events are handled. The
  46. kernel initially allocates 2000 of them, and sets aside MAXSEPGCNT "pages"
  47. for allocation of more. It allocates precisely 20 new 12 byte event
  48. structures for each "page" of allocation. Given that the default
  49. MAXSEPGCNT is 1, and that the kernel actually seems to set aside a
  50. real 4Kb page for each request, we patched (the binary) to change that
  51. 20 to be 348, and set MAXSEPGCNT to be 8. We still run out occasionally,
  52. but only after long weekends...
  53.  
  54. So, the workaround is to include timeouts in your selects, and hope that
  55. someone at mti.sgi.com starts responding to the bugs list...
  56.  
  57. Chris
  58. -- 
  59. Chris Maltby - Softway Pty Ltd        Internet: chris@softway.sw.oz.au
  60.  
  61. PHONE:    +61-2-698-2322    "I'm waiting for X-Windows to become just that;
  62. FAX:    +61-2-699-9174     Ex-Windows" - A McGrath.
  63.