From owner-freebsd-current Sun Apr 5 04:32:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA07675 for freebsd-current-outgoing; Sun, 5 Apr 1998 04:32:31 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA07670 for ; Sun, 5 Apr 1998 04:32:28 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.5) with ESMTP id NAA07188; Sun, 5 Apr 1998 13:31:35 +0200 (CEST) To: =?koi8-r?B?4c7E0sXKIP7F0s7P1w==?= cc: current@FreeBSD.ORG Subject: Re: dead hang after ppp started (with workaround) In-reply-to: Your message of "Sun, 05 Apr 1998 14:54:27 +0400." <19980405145427.14961@nagual.pp.ru> Date: Sun, 05 Apr 1998 13:31:35 +0200 Message-ID: <7186.891775895@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Try this patch... I overlooked something in the itimer handling... Index: kern_time.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_time.c,v retrieving revision 1.48 diff -u -r1.48 kern_time.c --- kern_time.c 1998/04/05 10:28:01 1.48 +++ kern_time.c 1998/04/05 11:30:46 @@ -102,10 +102,6 @@ ts.tv_nsec = tv->tv_usec * 1000; set_timecounter(&ts); (void) splsoftclock(); - for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { - if (timerisset(&p->p_realtimer.it_value)) - timevaladd(&p->p_realtimer.it_value, &delta); - } lease_updatetime(delta.tv_sec); splx(s); resettodr(); @@ -479,7 +475,7 @@ */ aitv = p->p_realtimer; if (timerisset(&aitv.it_value)) { - getmicrotime(&ctv); + getmicroruntime(&ctv); if (timercmp(&aitv.it_value, &ctv, <)) timerclear(&aitv.it_value); else @@ -533,6 +529,8 @@ if (timerisset(&aitv.it_value)) p->p_ithandle = timeout(realitexpire, (caddr_t)p, tvtohz(&aitv.it_value)); + getmicroruntime(&ctv); + timevaladd(&aitv.it_value, &ctv); p->p_realtimer = aitv; } else p->p_stats->p_timer[uap->which] = aitv; @@ -557,7 +555,7 @@ void *arg; { register struct proc *p; - struct timeval ctv; + struct timeval ctv, ntv; int s; p = (struct proc *)arg; @@ -570,11 +568,12 @@ s = splclock(); /* XXX: still neeeded ? */ timevaladd(&p->p_realtimer.it_value, &p->p_realtimer.it_interval); - getmicrotime(&ctv); + getmicroruntime(&ctv); if (timercmp(&p->p_realtimer.it_value, &ctv, >)) { + ntv = p->p_realtimer.it_value; + timevalsub(&ntv, &ctv); p->p_ithandle = - timeout(realitexpire, (caddr_t)p, - hzto(&p->p_realtimer.it_value) - 1); + timeout(realitexpire, (caddr_t)p, tvtohz(&ntv)); splx(s); return; } -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "Drink MONO-tonic, it goes down but it will NEVER come back up!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message