FreeBSD/sys/netinet/ip_reass.c
/*
 * After maxnipq has been updated, propagate the change to UMA.  The UMA zone
 * max has slightly different semantics than the sysctl, for historical
 * reasons.
 */
After maxnipq has been updated, propagate the change to UMA.  The UMA zone
max has slightly different semantics than the sysctl, for historical
reasons.
After maxnipq has been updated propagate the change to UMA . The UMA zone max has slightly different semantics than the sysctl for historical reasons .
static void
ipreass_drain_tomax(void)
{
	int target;
	target = uma_zone_get_max(V_ipq_zone);
	while (uma_zone_get_cur(V_ipq_zone) > target) {
		struct ipq *fp;
		for (int i = 0; i < IPREASS_NHASH; i++) {
			IPQ_LOCK(i);
			fp = TAILQ_LAST(&V_ipq[i].head, ipqhead);
			if (fp != NULL)
				ipq_timeout(&V_ipq[i].head, fp);
			IPQ_UNLOCK(i);
		}
	}
}
static void ipreass_drain_tomax ( void ) { int target ; target = uma_zone_get_max ( V_ipq_zone ) ; while ( uma_zone_get_cur ( V_ipq_zone ) > target ) { struct ipq * fp ; for ( int i = 0 ; i < IPREASS_NHASH ; i ++ ) { IPQ_LOCK ( i ) ; fp = TAILQ_LAST ( & V_ipq [ i ] . head , ipqhead ) ; if ( fp != NULL ) ipq_timeout ( & V_ipq [ i ] . head , fp ) ; IPQ_UNLOCK ( i ) ; } } }
After maxnipq has been updated, propagate the change to UMA.
After maxnipq has been updated propagate the change to UMA .
/*
	 * If we are over the maximum number of fragments,
	 * drain off enough to get down to the new limit,
	 * stripping off last elements on queues.  Every
	 * run we strip the oldest element from each bucket.
	 */