Date: Mon, 13 Apr 2015 09:17:58 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281487 - stable/10/sys/kern Message-ID: <201504130917.t3D9HwYA067848@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Apr 13 09:17:57 2015 New Revision: 281487 URL: https://svnweb.freebsd.org/changeset/base/281487 Log: MFC r280850: 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). Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Mon Apr 13 08:35:03 2015 (r281486) +++ stable/10/sys/kern/subr_vmem.c Mon Apr 13 09:17:57 2015 (r281487) @@ -746,6 +746,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?201504130917.t3D9HwYA067848>