Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2017 23:33:14 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313784 - head/sys/sys
Message-ID:  <201702152333.v1FNXE1u097301@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Feb 15 23:33:14 2017
New Revision: 313784
URL: https://svnweb.freebsd.org/changeset/base/313784

Log:
  rwlock: tidy up r313392
  
  While a new bit was added and thread alignment got shifted to accomodate it,
  RW_READERS_SHIFT was not modified accordingly and clashed with the new flag.
  
  This was surprisingly harmless. If the lock was taken for writing, other flags
  were tested. If the lock was taken for reading, it would correctly work for
  readers > 1 and this was the only relevant test performed.

Modified:
  head/sys/sys/rwlock.h

Modified: head/sys/sys/rwlock.h
==============================================================================
--- head/sys/sys/rwlock.h	Wed Feb 15 23:04:25 2017	(r313783)
+++ head/sys/sys/rwlock.h	Wed Feb 15 23:33:14 2017	(r313784)
@@ -65,7 +65,7 @@
 #define	RW_LOCK_WAITERS		(RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)
 
 #define	RW_OWNER(x)		((x) & ~RW_LOCK_FLAGMASK)
-#define	RW_READERS_SHIFT	4
+#define	RW_READERS_SHIFT	5
 #define	RW_READERS(x)		(RW_OWNER((x)) >> RW_READERS_SHIFT)
 #define	RW_READERS_LOCK(x)	((x) << RW_READERS_SHIFT | RW_LOCK_READ)
 #define	RW_ONE_READER		(1 << RW_READERS_SHIFT)



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