Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 1999 08:57:13 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        fenner@parc.xerox.com, jgreco@solaria.sol.net
Cc:        current@FreeBSD.ORG
Subject:   Re: Lots of arpresolve: can't allocate llinfo for <addr>rt
Message-ID:  <199901122157.IAA32727@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>getting a bit irritating...  I'm using a serial console and during very
>heavy message-spews, the machine seems to "freeze" for seconds at a time
>and I'm pretty sure its because the system is waiting for the 9600 baud
>console to print.  I've got a whole different set of complaints about the
>serial console handling, oh well.

Try this patch.  ttymsg() can fill up the process table for heavy
message-spews.  Serial console handling is relatively perfect :-).

Bruce

diff -c2 ttymsg.c~ ttymsg.c
*** ttymsg.c~	Sat Jul 25 04:51:47 1998
--- ttymsg.c	Sat Jul 25 04:52:56 1998
***************
*** 42,45 ****
--- 42,46 ----
  #include <sys/types.h>
  #include <sys/uio.h>
+ #include <sys/wait.h>
  #include <dirent.h>
  #include <errno.h>
***************
*** 70,74 ****
  	register int cnt, fd, left, wret;
  	struct iovec localiov[7];
! 	int forked = 0;
  
  	if (iovcnt > sizeof(localiov) / sizeof(localiov[0]))
--- 71,92 ----
  	register int cnt, fd, left, wret;
  	struct iovec localiov[7];
! 	int forked = 0, status;
! 	static pid_t cpid = 0;
! 	pid_t pid;
! 
! 	/*
! 	 * Don't do anything if a child is still alive.  Interleaved
! 	 * output would not be good, and filling the process table with
! 	 * as many children as we can fork before the timeout kills them
! 	 * would be worse.  Waiting here also reduces the need to handle
! 	 * SIGCHLD in callers.
! 	 */
! 	if (cpid) {
! 		pid = waitpid(cpid, &status, WNOHANG);
! 		if (pid == cpid || (pid == -1 || errno == ECHILD))
! 			cpid = 0;
! 		else
! 			return (NULL);
! 	}
  
  	if (iovcnt > sizeof(localiov) / sizeof(localiov[0]))
***************
*** 121,125 ****
  		}
  		if (errno == EWOULDBLOCK) {
! 			int cpid, off = 0;
  
  			if (forked) {
--- 139,143 ----
  		}
  		if (errno == EWOULDBLOCK) {
! 			int off = 0;
  
  			if (forked) {

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901122157.IAA32727>