Subject: bin/4143: problem with portmapper
To: None <gnats-bugs@gnats.netbsd.org>
From: None <arnd@harvey.uni-koblenz.de>
List: netbsd-bugs
Date: 09/23/1997 18:55:19
>Number:         4143
>Category:       bin
>Synopsis:       large number of system calls from prtmapper
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 10:05:04 1997
>Last-Modified:
>Originator:     Uwe Arndt
>Organization:
Uwe Arndt			| Universitaet Koblenz
EMAIL: arndt@uni-koblenz.de	| Rheinau 1, D-56075 Koblenz
T: +49 261 9119 642		| FAX: +49 261 9119 495
>Release:        Thu Aug  7 11:30:27
>Environment:
	
System: NetBSD harvey.uni-koblenz.de 1.2G NetBSD 1.2G (UWES) #1: Tue Aug 26 15:57:48 CEST 1997 root@harvey.uni-koblenz.de:/usr/src/sys/arch/i386/compile/UWES i386


>Description:
	I experience extremly large numbers of system calls (highest number
	near 300000 from vmstat 1). This makes the machine really slow.
>How-To-Repeat:
	Happens from time to time :-(
>Fix:
	I changed a piece of code in portmap, but I'm really not sure if this
	is the right cure. In the old case the loop was executed until all
	childs of portmap "died", and if that took some time, I could see
	many wait4 calls in ktrace. After the change wait is only called
	twice if other processes do not die.

*** k   Tue Sep 23 18:51:13 1997
--- portmap.c   Tue Sep 23 18:37:01 1997
***************
*** 562,568 ****
  {
        int save_errno = errno;
  
!       while (wait3(NULL, WNOHANG, NULL) != -1)
                ;
        errno = save_errno;
  }
--- 562,568 ----
  {
        int save_errno = errno;
  
!       while (wait3(NULL, WNOHANG, NULL) > 0)
                ;
        errno = save_errno;
  }

>Audit-Trail:
>Unformatted: