Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 2020 18:31:58 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364460 - head/sys/vm
Message-ID:  <202008211831.07LIVw7Q043519@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gallatin
Date: Fri Aug 21 18:31:57 2020
New Revision: 364460
URL: https://svnweb.freebsd.org/changeset/base/364460

Log:
  uma: record allocation failures due to zone limits
  
  The zone limit mechanism was recently reworked, and
  allocation failures due to limits being exceeded
  were inadvertently no longer being recorded. This
  would lead to, for example, mbuf allocation failures
  not being indicated in netstat -m or vmstat -z
  
  Reviewed by:	markj
  Sponsored by:	Netflix

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Fri Aug 21 17:45:17 2020	(r364459)
+++ head/sys/vm/uma_core.c	Fri Aug 21 18:31:57 2020	(r364460)
@@ -3952,8 +3952,10 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma
 {
 	void *item;
 
-	if (zone->uz_max_items > 0 && zone_alloc_limit(zone, 1, flags) == 0)
+	if (zone->uz_max_items > 0 && zone_alloc_limit(zone, 1, flags) == 0) {
+		counter_u64_add(zone->uz_fails, 1);
 		return (NULL);
+	}
 
 	/* Avoid allocs targeting empty domains. */
 	if (domain != UMA_ANYDOMAIN && VM_DOMAIN_EMPTY(domain))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008211831.07LIVw7Q043519>