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