Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2012 22:30:30 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243999 - head/sys/kern
Message-ID:  <201212072230.qB7MUUnY098797@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Fri Dec  7 22:30:30 2012
New Revision: 243999
URL: http://svnweb.freebsd.org/changeset/base/243999

Log:
  Configure UMA warnings for the following zones:
  - unp_zone: kern.ipc.maxsockets limit reached
  - socket_zone: kern.ipc.maxsockets limit reached
  - zone_mbuf: kern.ipc.nmbufs limit reached
  - zone_clust: kern.ipc.nmbclusters limit reached
  - zone_jumbop: kern.ipc.nmbjumbop limit reached
  - zone_jumbo9: kern.ipc.nmbjumbo9 limit reached
  - zone_jumbo16: kern.ipc.nmbjumbo16 limit reached
  
  Note that those warnings are printed not often than every five minutes and can
  be globally turned off by setting sysctl/tunable vm.zone_warnings to 0.
  
  Discussed on:	arch
  Obtained from:	WHEEL Systems
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_mbuf.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Fri Dec  7 22:27:13 2012	(r243998)
+++ head/sys/kern/kern_mbuf.c	Fri Dec  7 22:30:30 2012	(r243999)
@@ -306,6 +306,7 @@ mbuf_init(void *dummy)
 	    MSIZE - 1, UMA_ZONE_MAXBUCKET);
 	if (nmbufs > 0)
 		nmbufs = uma_zone_set_max(zone_mbuf, nmbufs);
+	uma_zone_set_warning(zone_mbuf, "kern.ipc.nmbufs limit reached");
 
 	zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES,
 	    mb_ctor_clust, mb_dtor_clust,
@@ -317,6 +318,7 @@ mbuf_init(void *dummy)
 	    UMA_ALIGN_PTR, UMA_ZONE_REFCNT);
 	if (nmbclusters > 0)
 		nmbclusters = uma_zone_set_max(zone_clust, nmbclusters);
+	uma_zone_set_warning(zone_clust, "kern.ipc.nmbclusters limit reached");
 
 	zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack,
 	    mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf);
@@ -332,6 +334,7 @@ mbuf_init(void *dummy)
 	    UMA_ALIGN_PTR, UMA_ZONE_REFCNT);
 	if (nmbjumbop > 0)
 		nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop);
+	uma_zone_set_warning(zone_jumbop, "kern.ipc.nmbjumbop limit reached");
 
 	zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES,
 	    mb_ctor_clust, mb_dtor_clust,
@@ -344,6 +347,7 @@ mbuf_init(void *dummy)
 	uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc);
 	if (nmbjumbo9 > 0)
 		nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9);
+	uma_zone_set_warning(zone_jumbo9, "kern.ipc.nmbjumbo9 limit reached");
 
 	zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES,
 	    mb_ctor_clust, mb_dtor_clust,
@@ -356,6 +360,7 @@ mbuf_init(void *dummy)
 	uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc);
 	if (nmbjumbo16 > 0)
 		nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16);
+	uma_zone_set_warning(zone_jumbo16, "kern.ipc.nmbjumbo16 limit reached");
 
 	zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int),
 	    NULL, NULL,

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Fri Dec  7 22:27:13 2012	(r243998)
+++ head/sys/kern/uipc_socket.c	Fri Dec  7 22:30:30 2012	(r243999)
@@ -276,6 +276,7 @@ socket_init(void *tag)
 	socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
 	maxsockets = uma_zone_set_max(socket_zone, maxsockets);
+	uma_zone_set_warning(socket_zone, "kern.ipc.maxsockets limit reached");
 	EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL,
 	    EVENTHANDLER_PRI_FIRST);
 }

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Fri Dec  7 22:27:13 2012	(r243998)
+++ head/sys/kern/uipc_usrreq.c	Fri Dec  7 22:30:30 2012	(r243999)
@@ -1778,6 +1778,7 @@ unp_init(void)
 	if (unp_zone == NULL)
 		panic("unp_init");
 	uma_zone_set_max(unp_zone, maxsockets);
+	uma_zone_set_warning(unp_zone, "kern.ipc.maxsockets limit reached");
 	EVENTHANDLER_REGISTER(maxsockets_change, unp_zone_change,
 	    NULL, EVENTHANDLER_PRI_ANY);
 	LIST_INIT(&unp_dhead);



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