From owner-svn-src-all@freebsd.org Tue Dec 13 20:11:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDD7C76CAB; Tue, 13 Dec 2016 20:11:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7B7D4DF1; Tue, 13 Dec 2016 20:11:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDKBjag005898; Tue, 13 Dec 2016 20:11:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDKBjIt005897; Tue, 13 Dec 2016 20:11:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612132011.uBDKBjIt005897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Dec 2016 20:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310032 - head/sys/kern X-SVN-Group: head 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.23 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: Tue, 13 Dec 2016 20:11:46 -0000 Author: glebius Date: Tue Dec 13 20:11:45 2016 New Revision: 310032 URL: https://svnweb.freebsd.org/changeset/base/310032 Log: Zero return value when counter_rate() switches over to next second and value is positive, but below the limit. Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Tue Dec 13 19:58:21 2016 (r310031) +++ head/sys/kern/subr_counter.c Tue Dec 13 20:11:45 2016 (r310032) @@ -154,6 +154,8 @@ counter_ratecheck(struct counter_rate *c counter_u64_zero(cr->cr_rate); cr->cr_over = 0; cr->cr_ticks = now; + if (val <= limit) + val = 0; } atomic_store_rel_int(&cr->cr_lock, 0); } else