Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Apr 1998 01:34:20 +0400
From:      =?koi8-r?B?4c7E0sXKIP7F0s7P1w==?= <ache@nagual.pp.ru>
To:        "Alok K. Dhir" <adhir@worldbank.org>, current@FreeBSD.ORG, phk@FreeBSD.ORG
Cc:        adkin003@tc.umn.edu
Subject:   Re: More info RE: X slowdown in -current
Message-ID:  <19980403013420.63188@nagual.pp.ru>
In-Reply-To: <19980402225744.22309@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Apr 02, 1998 at 10:57:44PM %2B0400
References:  <Pine.BSF.3.96.980402134204.620A-100000@shadow.worldbank.org> <19980402225744.22309@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 02, 1998 at 10:57:44PM +0400, Андрей Чернов wrote:
> On Thu, Apr 02, 1998 at 01:43:48PM -0500, Alok K. Dhir wrote:
> > 
> > In case it helps debug the problem, the apps most affected (i.e. 
> > visibily) by this slowdown are Netscape and xterm.  None of my other
> > "staple" apps are visibly affected.  Even rxvt is fine... 
> > 
> > ---------- Forwarded message ----------
> > Date: Thu, 2 Apr 1998 13:14:37 -0500 (EST)
> > From: "Alok K. Dhir" <adhir@worldbank.org>
> > To: current@freebsd.org
> > Subject: X slowdown in -current
> > 
> > The slowdown still exists on a kernel and its world supped and made at
> > 11:30am today.  I saw a commit go by from phk that I thought was supposed
> > to fix this problem, but it doesn't seem to have worked for me.
> 
> 
> The reason is that phk's fix really _not_ fix anything, try the patch
> posted in current recently instead, it works! 
> 

This one (related to latest -current) really works, maybe because
splhigh() removed:

*** sys_generic.c.orig	Thu Apr  2 11:22:17 1998
--- sys_generic.c	Fri Apr  3 01:22:00 1998
***************
*** 538,545 ****
  	 */
  	fd_mask s_selbits[howmany(2048, NFDBITS)];
  	fd_mask *ibits[3], *obits[3], *selbits, *sbp;
! 	struct timeval atv;
! 	int s, ncoll, error, timo, term;
  	u_int nbufbytes, ncpbytes, nfdbits;
  
  	if (uap->nd < 0)
--- 538,545 ----
  	 */
  	fd_mask s_selbits[howmany(2048, NFDBITS)];
  	fd_mask *ibits[3], *obits[3], *selbits, *sbp;
! 	struct timeval atv, ctv;
! 	int s, ncoll, error, timo;
  	u_int nbufbytes, ncpbytes, nfdbits;
  
  	if (uap->nd < 0)
***************
*** 600,627 ****
  			error = EINVAL;
  			goto done;
  		}
! 		term = ticks + tvtohz(&atv);
  	} else
! 		term = 0;
  retry:
  	ncoll = nselcoll;
  	p->p_flag |= P_SELECT;
  	error = selscan(p, ibits, obits, uap->nd);
  	if (error || p->p_retval[0])
  		goto done;
! 	s = splhigh();
! 	if (term && term <= ticks) {
! 		splx(s);
  		goto done;
  	}
- 	timo = term ? term - ticks : 0;
  	if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) {
- 		splx(s);
  		goto retry;
  	}
  	p->p_flag &= ~P_SELECT;
  	error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "select", timo);
- 	splx(s);
  	if (error == 0)
  		goto retry;
  done:
--- 600,627 ----
  			error = EINVAL;
  			goto done;
  		}
! 		getmicrotime(&ctv);
! 		timevaladd(&atv, &ctv);
! 		timo = hzto(&atv);
  	} else
! 		timo = 0;
  retry:
  	ncoll = nselcoll;
  	p->p_flag |= P_SELECT;
  	error = selscan(p, ibits, obits, uap->nd);
  	if (error || p->p_retval[0])
  		goto done;
! 	getmicrotime(&ctv);
! 	/* this should be timercmp(&time, &atv, >=) */
! 	if (uap->tv && (ctv.tv_sec > atv.tv_sec ||
! 	    (ctv.tv_sec == atv.tv_sec && ctv.tv_usec >= atv.tv_usec))) {
  		goto done;
  	}
  	if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) {
  		goto retry;
  	}
  	p->p_flag &= ~P_SELECT;
  	error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "select", timo);
  	if (error == 0)
  		goto retry;
  done:
***************
*** 701,708 ****
  {
  	caddr_t bits;
  	char smallbits[32 * sizeof(struct pollfd)];
! 	struct timeval atv;
! 	int s, ncoll, error = 0, timo, term;
  	size_t ni;
  
  	if (SCARG(uap, nfds) > p->p_fd->fd_nfiles) {
--- 701,708 ----
  {
  	caddr_t bits;
  	char smallbits[32 * sizeof(struct pollfd)];
! 	struct timeval atv, ctv;
! 	int s, ncoll, error = 0, timo;
  	size_t ni;
  
  	if (SCARG(uap, nfds) > p->p_fd->fd_nfiles) {
***************
*** 724,751 ****
  			error = EINVAL;
  			goto done;
  		}
! 		term = ticks + tvtohz(&atv);
  	} else
! 		term = 0;
  retry:
  	ncoll = nselcoll;
  	p->p_flag |= P_SELECT;
  	error = pollscan(p, (struct pollfd *)bits, SCARG(uap, nfds));
  	if (error || p->p_retval[0])
  		goto done;
! 	s = splhigh(); 
! 	if (term && term <= ticks) {
! 		splx(s);
  		goto done;
  	}
- 	timo = term ? term - ticks : 0;
  	if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) {
- 		splx(s);
  		goto retry;
  	}
  	p->p_flag &= ~P_SELECT;
  	error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "poll", timo);
- 	splx(s);
  	if (error == 0)
  		goto retry;
  done:
--- 724,749 ----
  			error = EINVAL;
  			goto done;
  		}
! 		getmicrotime(&ctv);
! 		timevaladd(&atv, &ctv);
! 		timo = hzto(&atv);
  	} else
! 		timo = 0;
  retry:
  	ncoll = nselcoll;
  	p->p_flag |= P_SELECT;
  	error = pollscan(p, (struct pollfd *)bits, SCARG(uap, nfds));
  	if (error || p->p_retval[0])
  		goto done;
! 	getmicrotime(&ctv);
! 	if (timo && timercmp(&ctv, &atv, >=)) {
  		goto done;
  	}
  	if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) {
  		goto retry;
  	}
  	p->p_flag &= ~P_SELECT;
  	error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "poll", timo);
  	if (error == 0)
  		goto retry;
  done:



-- 
Andrey A. Chernov
http://www.nagual.pp.ru/~ache/
MTH/SH/HE S-- W-- N+ PEC>+ D A a++ C G>+ QH+(++) 666+>++ Y

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?19980403013420.63188>