Subject: Printer speedup
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Douglas Crosher <dtc@stan.xx.swin.OZ.AU>
List: current-users
Date: 08/13/1994 03:11:07
I found that I had been getting poor printer transfer performance
particularly when using ghostscript.  My setup is a 486DX33 with
an HP LaserJet 4L, using the /dev/lpa0 device, and with NetBSD-current.
After looking into it I found that the driver was tsleeping excessively.  I
was able to overcome this by setting a minimum value on
spinmax, patch below:

-=-=-=-=-=-=-=-
*** lpt.c       Wed Aug 10 02:59:54 1994
--- lpt.c.orig  Wed Aug 10 00:58:39 1994
***************
*** 438,444 ****
                        outb(iobase + lpt_control, control);
  
                        /* adapt busy-wait algorithm */
!                       if (spin*2 + 2*16 < sc->sc_spinmax)
                                sc->sc_spinmax--;
                }
        } else {
--- 438,444 ----
                        outb(iobase + lpt_control, control);
  
                        /* adapt busy-wait algorithm */
!                       if (spin*2 < sc->sc_spinmax)
                                sc->sc_spinmax--;
                }
        } else {
-=-=-=-=-=-=-

The value of 2*16 was chosen because I found that 16 was the average
value of spin and I double this to implement what I feel was
the intention in the driver.  This value will vary for different setups.

The speed improvement was useful, from more then 60 second at times to
just a few seconds :).

Regards
Douglas Crosher




------------------------------------------------------------------------------