home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / misc / 18751 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  7.5 KB

  1. Xref: sparky comp.sys.next.misc:18751 comp.sys.next.software:1210
  2. Newsgroups: comp.sys.next.misc,comp.sys.next.software
  3. Path: sparky!uunet!decwrl!mips!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!informatik.tu-muenchen.de!meyergru
  4. From: meyergru@Informatik.TU-Muenchen.DE (Uwe Meyer-Gruhl)
  5. Subject: Kernel patches continued... (Was: Ramdisk coming for NeXT)
  6. Keywords: Questions, questions...
  7. References: <1992Aug13.103230.6707@Informatik.TU-Muenchen.DE> <2A8A9B76.17419@noiro.acs.uci.edu> <1992Aug14.075240.8875@Informatik.TU-Muenchen.DE>
  8. Followup-To: comp.sys.next.misc
  9. Sender: MeyerGru@informatik.tu-muenchen.de
  10. Organization: Technische Universitaet Muenchen, Germany
  11. Date: Tue, 18 Aug 1992 09:13:16 GMT
  12. Message-ID: <1992Aug18.091316.29278@Informatik.TU-Muenchen.DE>
  13. Lines: 143
  14.  
  15. Hi folks,
  16.  
  17. I never thought that this thread I started would gather that much interest.
  18. Several people have asked me questions like:
  19.  
  20. 1. "What are these buffers anyway, doesn't MACH use all available
  21.     memory for buffering?"
  22. 2. "How do you know that your number of buffers is _right_,
  23.     i.e.optimal?"
  24. 3. "Is it necessary to NOP out the instructions at offset 334079?"
  25. 4. "How can I disable remote debugging, as it bothers me not to know
  26.     what can be done to my system's security that way?"
  27. 5. "What means kernel flag HZ, BUFPAGES, DSPISR?"
  28.  
  29. Wow. Kinda curious you guys, aren't you?
  30.  
  31. 1. As I already pointed out, I had the _feeling_ that 16 buffers are
  32.    too little on a system with a capacity of more than 1 GByte. Even
  33.    on a MESS-DOS-PC there is typically a much bigger number of
  34.    buffers involved. Moreover, most users have configured part of
  35.    their memory for a disk cache. O.K., they probably can't use it
  36.    other than that, but I thought that my NeXT would be faster this
  37.    way. Some people second my opinion, they also say that their
  38.    machine are slightly faster.
  39.  
  40. 2. I don't know. Period. I haven't had the time to test all
  41.    varieties. In theory, the more buffers you have, the less likely
  42.    it is for your computer to have to access the harddisk, and
  43.    the faster it is. My HP 9000/700 normally uses 10% of real memory
  44.    for buffers, so I thought this might be a nice point to start.
  45.    There are many parameters involved which can be essential for
  46.    you. Depending on your application, you may need more RAM for
  47.    calculations (e.g. Mathematica), or may want to optimize disk
  48.    accesses (like a database). Maybe you have plenty of RAM (32 MByte
  49.    or even more), so you can sacrifice some of it for buffers, maybe
  50.    not. Or maybe you have a file server which holds a huge amount of
  51.    data which cries for faster access. Maybe you own a 100/8 slab
  52.    and don't need that much buffer space. Matter-of-fact, however,
  53.    the slower the disk, the more effect have buffers (at least from
  54.    what I can tell by comparing, say, a Quantum "slow cat" LP105S and
  55.    a Fujitsu "noisy type" M2624SB).
  56.    Put simply, I have not tested with increasing buffer sizes and
  57.    measured the performance gain. Even if I had, I doubt that the
  58.    results would apply to one of you, since my system configuration
  59.    is rather unusual.
  60.  
  61. 3. I _think_ it is not necessary. The original patch has been
  62.    invented by me after a _few_ tests (see 2.) with "b sd()sdmach
  63.    nbuf=xxx". The instructions at offset 334079 (really 334078)
  64.    disassemble as:
  65.  
  66.     040516a6    tstl    0x4093814:l    ;Test NBUF value
  67.     040516ac    bnes    0x40516b6    ;if nonzero, go on.
  68.     040516ae    moveq    #16,d3        ;else, choose 16 as
  69.     040516b0    movel    d3,0x4093814:l    ;default and set NBUF
  70.     040516b6    movel    #0x2000,d0    ;code continues here
  71.  
  72.    Originally, I just patched the #16 into whatever popped into my
  73.    head to set the default. This has the disadvantage that at most
  74.    127 buffers can be used. The instruction is a move _quick_, so the
  75.    value 128 equals -1, which is a _very_ large integer if taken
  76.    unsigned and causes a system panic when mallocing the buffers
  77.    accordingly.
  78.    Later, my friend Christian Baur NOPed out the moveq and movel
  79.    instructions and found out the offset of NBUF in the file.
  80.    I am not quite sure if he had other reasons to both nop out
  81.    these instructions and initialise NBUF to a value other than zero.
  82.    I can assure you that my/his patch works fine, so why bother?
  83.    Marc Albert Ullman (who also wrote binpatch.c, remember?) wrote,
  84.    that he noticed a difference in performance (BTW: better or
  85.    not, Marc?). I can neither neglect nor deny that, since I haven't
  86.    tested it yet.
  87.  
  88. 4. I also wondered how one can disable that feature. I think it
  89.    has been implemented in order to make kernel debugging possible,
  90.    but don't know for sure. Two things one could try are:
  91.  
  92.    a) Try all "debug" flags. When you startup your next with
  93.       "b sd() sdmach -s" (single-user mode), the debug flag is 0x200,
  94.       as can be seen in the system log (This is from memory,
  95.       so don't blame me). Maybe the remote debugging flag is some
  96.       other bit in that word.
  97.    b) There is a kernel flag named "rmtdebug", which is normally 0.
  98.       It is _more_ likely that setting this flag to some appropriate
  99.       value (e.g. 1?) will disable remote debugging.
  100.  
  101.    Remember, folks, this is _hacking_, not recipes. You may crash
  102.    your systems by poking around in the kernel! I have not done this
  103.    yet, so I can't tell you how to do it safely. Maybe somebody
  104.    will give it a try and post about the results?
  105.  
  106. 5. Phew. I don't know, either. The list made by Richard "Terminally
  107.    curious" O'Neill is something I had also done to find out the
  108.    names of kernel flags. It seems pretty complete and follows here:
  109.  
  110. |>   hz phz nbuf bufpages pagesize mem dspicr dspcvr dspisr dspivr
  111. |>   dsph dspm dspl debug maxphys ncallout breakpoint rmtdebug
  112. |>   od_frmr od_land od_spin od_noverify od_maxecc od_maxecc_l1
  113. |>   od_maxecc_h1 od_maxecc_l2 od_maxecc_h2 od_write_retry od_flgstr1
  114. |>   od_flgstr2 mi_rv_delay mi_expire mi_expire_sh mi_expire_sh2
  115. |>   mi_expire_jmp mi_expire_max od_errmsg_filter
  116. |>   od_id_r od_id_v od_id_o od_requested od_dbug init rootdir
  117. |>   rootdev rootrw astune_rate astune_calls
  118. |> 
  119.  
  120. |> I've got little idea which ones one can safely play with, or what
  121. |> they do.  'rootdir', 'rootdev' and 'rootrw' look like they could
  122. |> be useful to some people. 'bufpages' also looks interesting, since
  123. |> it seems related to 'nbuf'.
  124. |> 
  125.  
  126. |> The only one I actually have seen documented is 'mem' (in
  127. |> NeXTanswers, misc.575).
  128. |> 
  129.  
  130.    This goes for me, too. Some of these flags obviously have to do
  131.    with the optical disk (od*). Some seem to be related to the dsp
  132.    (dsp*). I can see little or no benefits from trying to change
  133.    these. HZ is usually a system constant used for clock() and
  134.    similar routines. PHZ seems to be related to HZ. That is all I
  135.    can suspect from the names themselves. I myself will most probably
  136.    _not_ fiddle with those flags any more, as I am curiously awaiting
  137.    NS 3.0, but maybe someone likes to volunteer?
  138.  
  139. As you may have noted, the answer to most of the questions is: "I
  140. don't know", but aren't they cute, anyway? At the time being, I am
  141. busy getting my doctor's degree, so I can't do everything I would
  142. like to, and deep hacking is one of these things, as it costs time.
  143. >From time to time I change some things that tease me and while
  144. looking at them I see other threads I could follow, but...see above.
  145.  
  146. Alright. Now I'm going to locate my asbestos suit and wait for the
  147. flames against my "most longish and useless posting ever".
  148.  
  149. cheers, Uwe
  150.  
  151. Uwe Meyer-Gruhl                      "Close female relative wear combat boots"
  152. Lehrstuhl Informatik IX
  153. Technische Universitaet Muenchen     email:MeyerGru@Informatik.TU-Muenchen.DE
  154. Orleansstr. 34, D-8000 Muenchen 80   tel: ++49 89 48095-209
  155.  
  156.  
  157.  
  158.