Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2018 11:46:45 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r327587 - stable/11/sys/vm
Message-ID:  <201801051146.w05BkjOQ048262@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jan  5 11:46:45 2018
New Revision: 327587
URL: https://svnweb.freebsd.org/changeset/base/327587

Log:
  MFC r327359:
  Do not lock vm map in swapout_procs().

Modified:
  stable/11/sys/vm/vm_swapout.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_swapout.c
==============================================================================
--- stable/11/sys/vm/vm_swapout.c	Fri Jan  5 11:45:40 2018	(r327586)
+++ stable/11/sys/vm/vm_swapout.c	Fri Jan  5 11:46:45 2018	(r327587)
@@ -727,7 +727,6 @@ swapout_procs(int action)
 {
 	struct proc *p;
 	struct thread *td;
-	struct vmspace *vm;
 	int minslptime, slptime;
 	bool didswap;
 
@@ -761,24 +760,6 @@ retry:
 		PROC_UNLOCK(p);
 		sx_sunlock(&allproc_lock);
 
-		/*
-		 * Do not swapout a process that
-		 * is waiting for VM data
-		 * structures as there is a possible
-		 * deadlock.  Test this first as
-		 * this may block.
-		 *
-		 * Lock the map until swapout
-		 * finishes, or a thread of this
-		 * process may attempt to alter
-		 * the map.
-		 */
-		vm = vmspace_acquire_ref(p);
-		if (vm == NULL)
-			goto nextproc2;
-		if (!vm_map_trylock(&vm->vm_map))
-			goto nextproc1;
-
 		PROC_LOCK(p);
 		if (p->p_lock != 1 || (p->p_flag & (P_STOPPED_SINGLE |
 		    P_TRACED | P_SYSTEM)) != 0)
@@ -865,17 +846,11 @@ retry:
 				if (swapout(p) == 0)
 					didswap = true;
 				PROC_UNLOCK(p);
-				vm_map_unlock(&vm->vm_map);
-				vmspace_free(vm);
 				goto retry;
 			}
 		}
 nextproc:
 		PROC_UNLOCK(p);
-		vm_map_unlock(&vm->vm_map);
-nextproc1:
-		vmspace_free(vm);
-nextproc2:
 		sx_slock(&allproc_lock);
 		PRELE(p);
 	}



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