Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2017 09:56:01 +0000 (UTC)
From:      "Jason A. Harmening" <jah@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312153 - head/sys/i386/i386
Message-ID:  <201701140956.v0E9u1DU088364@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jah
Date: Sat Jan 14 09:56:01 2017
New Revision: 312153
URL: https://svnweb.freebsd.org/changeset/base/312153

Log:
  For i386 temporary mappings, unpin the thread before releasing
  the cmap lock.  Releasing the lock first may result in the thread
  being immediately rescheduled and bound to the same CPU, only to
  unpin itself upon resuming execution.
  
  Noted by:	skra (in review for armv6 equivalent)
  MFC after:	1 week

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Jan 14 09:47:06 2017	(r312152)
+++ head/sys/i386/i386/pmap.c	Sat Jan 14 09:56:01 2017	(r312153)
@@ -4216,8 +4216,8 @@ pmap_zero_page(vm_page_t m)
 	invlcaddr(pc->pc_cmap_addr2);
 	pagezero(pc->pc_cmap_addr2);
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -4244,8 +4244,8 @@ pmap_zero_page_area(vm_page_t m, int off
 	else
 		bzero(pc->pc_cmap_addr2 + off, size);
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -4275,8 +4275,8 @@ pmap_copy_page(vm_page_t src, vm_page_t 
 	bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE);
 	*cmap_pte1 = 0;
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 int unmapped_buf_allowed = 1;
@@ -4323,8 +4323,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
 	}
 	*cmap_pte1 = 0;
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -5310,8 +5310,8 @@ pmap_flush_page(vm_page_t m)
 		if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
 			mfence();
 		*cmap_pte2 = 0;
-		mtx_unlock(&pc->pc_cmap_lock);
 		sched_unpin();
+		mtx_unlock(&pc->pc_cmap_lock);
 	} else
 		pmap_invalidate_cache();
 }



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