Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jun 2011 16:21:43 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223478 - head/sys/ia64/ia64
Message-ID:  <201106231621.p5NGLhF2006635@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Thu Jun 23 16:21:43 2011
New Revision: 223478
URL: http://svn.freebsd.org/changeset/base/223478

Log:
  Unblock the outgoing thread after we performed pmap_switch() to
  switch the region registers. pmap_switch() returns the pmap for
  which the region register are currently programmed, which needs
  to be re-programmed on the CPU the ougoing thread gets switched
  in.  This change does not noticibly change anything or fix known
  bugs, but does give me a warm fuzzy feeling by being more
  correct.

Modified:
  head/sys/ia64/ia64/machdep.c

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Thu Jun 23 15:53:17 2011	(r223477)
+++ head/sys/ia64/ia64/machdep.c	Thu Jun 23 16:21:43 2011	(r223478)
@@ -470,12 +470,12 @@ cpu_switch(struct thread *old, struct th
 	if (PCPU_GET(fpcurthread) == old)
 		old->td_frame->tf_special.psr |= IA64_PSR_DFH;
 	if (!savectx(oldpcb)) {
-		atomic_store_rel_ptr(&old->td_lock, mtx);
-
 		newpcb = new->td_pcb;
 		oldpcb->pcb_current_pmap =
 		    pmap_switch(newpcb->pcb_current_pmap);
 
+		atomic_store_rel_ptr(&old->td_lock, mtx);
+
 #if defined(SCHED_ULE) && defined(SMP)
 		while (atomic_load_acq_ptr(&new->td_lock) == &blocked_lock)
 			cpu_spinwait();



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