Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2009 01:26:01 +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: r200498 - head/lib/libthr/thread
Message-ID:  <200912140126.nBE1Q1Zv003701@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Mon Dec 14 01:26:01 2009
New Revision: 200498
URL: http://svn.freebsd.org/changeset/base/200498

Log:
  Work-around a race condition on ia64 while unlocking a contested lock.
  The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64,
  we simply go to the kernel to unlock.
  The big question is why this is only a race condition on ia64...
  
  MFC after:	3 days

Modified:
  head/lib/libthr/thread/thr_umtx.c

Modified: head/lib/libthr/thread/thr_umtx.c
==============================================================================
--- head/lib/libthr/thread/thr_umtx.c	Mon Dec 14 01:10:05 2009	(r200497)
+++ head/lib/libthr/thread/thr_umtx.c	Mon Dec 14 01:26:01 2009	(r200498)
@@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt
 int
 __thr_umutex_unlock(struct umutex *mtx, uint32_t id)
 {
+#ifndef __ia64__
+	/* XXX this logic has a race-condition on ia64. */
 	if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
 		atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED);
 		return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0);
 	}
+#endif /* __ia64__ */
 	return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0);
 }
 



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