Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2013 20:33:57 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253221 - head/sys/vm
Message-ID:  <201307112033.r6BKXvFf012004@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jul 11 20:33:57 2013
New Revision: 253221
URL: http://svnweb.freebsd.org/changeset/base/253221

Log:
  When swap pager allocates metadata in the pagedaemon context, allow it
  to drain the reserve.  This was broken in r243040, causing deadlock.
  Note that VM_WAIT call in case of uma_zalloc() failure from pagedaemon
  would only wait for the v_pageout_free_min anyway.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Thu Jul 11 20:09:46 2013	(r253220)
+++ head/sys/vm/swap_pager.c	Thu Jul 11 20:33:57 2013	(r253221)
@@ -1855,7 +1855,8 @@ retry:
 		if (swapblk == SWAPBLK_NONE)
 			goto done;
 
-		swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT);
+		swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT |
+		    (curproc == pageproc ? M_USE_RESERVE : 0));
 		if (swap == NULL) {
 			mtx_unlock(&swhash_mtx);
 			VM_OBJECT_WUNLOCK(object);



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