Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2017 19:35:36 +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: r312191 - head/sys/i386/i386
Message-ID:  <201701141935.v0EJZaew026285@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jah
Date: Sat Jan 14 19:35:36 2017
New Revision: 312191
URL: https://svnweb.freebsd.org/changeset/base/312191

Log:
  Add comment explaining relative order of sched_unpin() and mtx_unlock().
  
  Suggested by:	alc
  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 18:04:12 2017	(r312190)
+++ head/sys/i386/i386/pmap.c	Sat Jan 14 19:35:36 2017	(r312191)
@@ -4216,6 +4216,12 @@ pmap_zero_page(vm_page_t m)
 	invlcaddr(pc->pc_cmap_addr2);
 	pagezero(pc->pc_cmap_addr2);
 	*cmap_pte2 = 0;
+
+	/*
+	 * Unpin the thread before releasing the lock.  Otherwise the thread
+	 * could be rescheduled while still bound to the current CPU, only
+	 * to unpin itself immediately upon resuming execution.
+	 */
 	sched_unpin();
 	mtx_unlock(&pc->pc_cmap_lock);
 }



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