Date: Tue, 8 Jun 2010 16:17:47 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208912 - head/sys/kern Message-ID: <201006081617.o58GHlKu050132@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Tue Jun 8 16:17:47 2010 New Revision: 208912 URL: http://svn.freebsd.org/changeset/base/208912 Log: Fix a sign bug that caused adaptive spinning in sx_xlock() to not work properly. Among other things it did not drop Giant while spinning leading to livelocks. Reviewed by: rookie, kib, jmallett MFC after: 3 days Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Jun 8 16:17:25 2010 (r208911) +++ head/sys/kern/kern_sx.c Tue Jun 8 16:17:47 2010 (r208912) @@ -511,7 +511,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t * running or the state of the lock changes. */ x = sx->sx_lock; - if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0) { + if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { if ((x & SX_LOCK_SHARED) == 0) { x = SX_OWNER(x); owner = (struct thread *)x;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006081617.o58GHlKu050132>