From owner-svn-src-all@FreeBSD.ORG Wed Apr 23 12:46:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B0C414A; Wed, 23 Apr 2014 12:46:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6778311EA; Wed, 23 Apr 2014 12:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NCkSnZ023328; Wed, 23 Apr 2014 12:46:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCkSZQ023327; Wed, 23 Apr 2014 12:46:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404231246.s3NCkSZQ023327@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Apr 2014 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264821 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:46:28 -0000 Author: mav Date: Wed Apr 23 12:46:27 2014 New Revision: 264821 URL: http://svnweb.freebsd.org/changeset/base/264821 Log: MFC r264550: Fix VIRTUAL and PROF interval timers for short intervals, broken at r247903. Due to the way those timers are implemented, we can't handle very short intervals. In addition to that mentioned patch caused math overflows for short intervals. To avoid that round those intervals to 1 tick. PR: kern/187668 Modified: stable/10/sys/kern/kern_time.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_time.c ============================================================================== --- stable/10/sys/kern/kern_time.c Wed Apr 23 12:16:36 2014 (r264820) +++ stable/10/sys/kern/kern_time.c Wed Apr 23 12:46:27 2014 (r264821) @@ -774,6 +774,14 @@ kern_setitimer(struct thread *td, u_int timevalsub(&oitv->it_value, &ctv); } } else { + if (aitv->it_interval.tv_sec == 0 && + aitv->it_interval.tv_usec != 0 && + aitv->it_interval.tv_usec < tick) + aitv->it_interval.tv_usec = tick; + if (aitv->it_value.tv_sec == 0 && + aitv->it_value.tv_usec != 0 && + aitv->it_value.tv_usec < tick) + aitv->it_value.tv_usec = tick; PROC_SLOCK(p); *oitv = p->p_stats->p_timer[which]; p->p_stats->p_timer[which] = *aitv;