From owner-freebsd-current Thu Apr 2 13:36:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA07744 for freebsd-current-outgoing; Thu, 2 Apr 1998 13:36:12 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ache.relcom.ru (ache@ache.relcom.ru [193.125.20.108]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA07515; Thu, 2 Apr 1998 13:34:37 -0800 (PST) (envelope-from ache@ache.relcom.ru) Received: (from ache@localhost) by ache.relcom.ru (8.8.8/8.8.8) id BAA00331; Fri, 3 Apr 1998 01:34:25 +0400 (MSD) (envelope-from ache) Message-ID: <19980403013420.63188@nagual.pp.ru> Date: Fri, 3 Apr 1998 01:34:20 +0400 From: =?koi8-r?B?4c7E0sXKIP7F0s7P1w==?= To: "Alok K. Dhir" , current@FreeBSD.ORG, phk@FreeBSD.ORG Cc: adkin003@tc.umn.edu Subject: Re: More info RE: X slowdown in -current Mail-Followup-To: "Alok K. Dhir" , current@FreeBSD.ORG, phk@freebsd.org, adkin003@tc.umn.edu References: <19980402225744.22309@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1i In-Reply-To: <19980402225744.22309@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Apr 02, 1998 at 10:57:44PM +0400 Organization: Biomechanoid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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" > > 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