From owner-freebsd-current Fri Apr 3 10:49:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA20934 for freebsd-current-outgoing; Fri, 3 Apr 1998 10:49:25 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from lsd.relcom.eu.net (ache@lsd.relcom.eu.net [193.125.27.73]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA20919 for ; Fri, 3 Apr 1998 10:49:21 -0800 (PST) (envelope-from ache@lsd.relcom.eu.net) Received: (from ache@localhost) by lsd.relcom.eu.net (8.8.8/8.8.8) id WAA07635; Fri, 3 Apr 1998 22:48:59 +0400 (MSD) (envelope-from ache) Message-ID: <19980403224858.27971@nagual.pp.ru> Date: Fri, 3 Apr 1998 22:48:58 +0400 From: =?koi8-r?B?4c7E0sXKIP7F0s7P1w==?= To: Poul-Henning Kamp , "Alok K. Dhir" , current@FreeBSD.ORG, adkin003@tc.umn.edu Subject: Working patch *with* splhigh() (Was Re: More info RE: X slowdown in -current) Mail-Followup-To: Poul-Henning Kamp , "Alok K. Dhir" , current@FreeBSD.ORG, adkin003@tc.umn.edu References: <19980403214836.43861@nagual.pp.ru> <2814.891626804@critter.freebsd.dk> <19980403222540.64574@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <19980403222540.64574@nagual.pp.ru>; from ache@nagual.pp.ru on Fri, Apr 03, 1998 at 10:25:40PM +0400 Organization: Biomechanoid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Well, here is working patch *WITH* splhigh(), since no errors here, it even can be commited until real solution found. So I take out my splhigh() claims. *** sys_generic.c.orig Thu Apr 2 11:22:17 1998 --- sys_generic.c Fri Apr 3 22:31:09 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,620 **** 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; --- 600,623 ---- 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; } ! s = splhigh(); if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) { splx(s); goto retry; *************** *** 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) { --- 704,711 ---- { 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,744 **** 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; --- 727,747 ---- 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; ! s = splhigh(); if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) { splx(s); goto retry; -- 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