Add comment explaining relative order of sched_unpin() and mtx_unlock().

Suggested by:	alc
MFC after:	1 week
This commit is contained in:
Jason A. Harmening 2017-01-14 19:35:36 +00:00
parent 59c6e3a58f
commit 86785b54a5

View File

@ -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);
}