svn commit: r310032 - head/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Tue Dec 13 20:11:46 UTC 2016


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


More information about the svn-src-head mailing list