From owner-freebsd-current Wed Jul 22 02:45:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA23815 for freebsd-current-outgoing; Wed, 22 Jul 1998 02:45:36 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA23751 for ; Wed, 22 Jul 1998 02:45:12 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id TAA09666; Wed, 22 Jul 1998 19:44:46 +1000 Date: Wed, 22 Jul 1998 19:44:46 +1000 From: Bruce Evans Message-Id: <199807220944.TAA09666@godzilla.zeta.org.au> To: FreeBSD-current@FreeBSD.ORG, pierre.dampure@k2c.co.uk Subject: Re: Current values of TTYHOG and RS_IBUFSIZE Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Way back in 1996 (23 Nov), Brian Litzinger posted a follow-up to "Hayes >ESP and interrupt-level buffer overflow" and advised altering the >following constants : > > In /sys/sys/tty.h: TTYHOG Change to 4096 > In /sys/i386/isa/sio.c RS_IBUFSIZE Change to 1024 > >I applied the above and haven't had any problems since -- in fact, it >seems the connections are _much_ faster. > >Can anybody confirms whether these changes are valid and, if so, can we >include them in -current (#ifdef'd via COM_ESP, of course)? These changes waste a lot of memory for ptys and any other non-ESP ttys, and don't get input flow control quite right (due to hard-coded 256's in tty.c). -current has support for allocating correctly sized buffers depending on the device type and port speed, but nothing actually uses this yet. The changes to use if for normal sio ports are something like: *** sio.c~ Wed Jul 15 22:30:11 1998 --- sio.c Wed Jul 15 22:30:15 1998 *************** *** 106,109 **** #define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */ - #define RB_I_HIGH_WATER (TTYHOG - 2 * RS_IBUFSIZE) #define RS_IBUFSIZE 256 --- 110,112 ---- #define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */ #define RS_IBUFSIZE 256 *************** *** 1190,1191 **** --- 1217,1221 ---- ? com->it_out : com->it_in; + tp->t_ififosize = 2 * RS_IBUFSIZE; + tp->t_ispeedwat = (speed_t)-1; + tp->t_ospeedwat = (speed_t)-1; (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET); *************** *** 1201,1203 **** */ - ttsetwater(tp); iobase = com->iobase; --- 1231,1232 ---- *************** *** 1983,1985 **** if (tp->t_state & TS_CAN_BYPASS_L_RINT) { ! if (tp->t_rawq.c_cc + incc >= RB_I_HIGH_WATER && (com->state & CS_RTS_IFLOW --- 2081,2083 ---- if (tp->t_state & TS_CAN_BYPASS_L_RINT) { ! if (tp->t_rawq.c_cc + incc > tp->t_ihiwat && (com->state & CS_RTS_IFLOW This gives an effective TTYHOG of about 11520 for 115200 bps, etc. RS_IBUFSIZE still needs to be increased for speeds larger than 115200 bps. RS_IBUFSIZE and/or tp->t_ififosize needs to be increased for hardware with large h/w fifos like the ESP. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message