Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Mar 2015 13:30:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280850 - head/sys/kern
Message-ID:  <201503301330.t2UDUsih095198@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Mar 30 13:30:53 2015
New Revision: 280850
URL: https://svnweb.freebsd.org/changeset/base/280850

Log:
  Periodically wake up threads waiting for vmem(9) resources, so they could
  ask for resource reclamation again.
  
  This is kind of dirty hack, but as last resort this is better then stuck
  indefinitely because of KVA fragmentation, waiting until some random event
  free something sufficient.  OpenSolaris also has this hack in its vmem(9).
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/subr_vmem.c

Modified: head/sys/kern/subr_vmem.c
==============================================================================
--- head/sys/kern/subr_vmem.c	Mon Mar 30 13:30:15 2015	(r280849)
+++ head/sys/kern/subr_vmem.c	Mon Mar 30 13:30:53 2015	(r280850)
@@ -747,6 +747,12 @@ vmem_periodic(void *unused, int pending)
 		/* Grow in powers of two.  Shrink less aggressively. */
 		if (desired >= current * 2 || desired * 4 <= current)
 			vmem_rehash(vm, desired);
+
+		/*
+		 * Periodically wake up threads waiting for resources,
+		 * so they could ask for reclamation again.
+		 */
+		VMEM_CONDVAR_BROADCAST(vm);
 	}
 	mtx_unlock(&vmem_list_lock);
 



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