diff --git a/nptl/pthread_rwlock_common.c b/nptl/pthread_rwlock_common.c
index 9b0b528298..295a5fbfc1 100644
--- a/nptl/pthread_rwlock_common.c
+++ b/nptl/pthread_rwlock_common.c
@@ -467,13 +467,27 @@ __pthread_rwlock_rdlock_full64 (pthread_rwlock_t *rwlock, clockid_t clockid,
 	      r = atomic_load_relaxed (&rwlock->__data.__readers);
 	      while ((r & PTHREAD_RWLOCK_WRPHASE) != 0)
 		{
+		  /* If we are the last reader, we also need to
+		     unblock any readers that are waiting for a writer
+		     to go first (PTHREAD_RWLOCK_RWAITING) so that
+		     they can register while the writer is active.
+		     See __pthread_rwlock_rdunlock above.  */
+		  unsigned int rnew = r - (1 << PTHREAD_RWLOCK_READER_SHIFT);
+		  if ((rnew >> PTHREAD_RWLOCK_READER_SHIFT) == 0)
+		    rnew &= ~(unsigned int) PTHREAD_RWLOCK_RWAITING;
+
 		  /* We don't need to make anything else visible to
 		     others besides unregistering, so relaxed MO is
 		     sufficient.  */
 		  if (atomic_compare_exchange_weak_relaxed
-		      (&rwlock->__data.__readers, &r,
-		       r - (1 << PTHREAD_RWLOCK_READER_SHIFT)))
-		    return err;
+		      (&rwlock->__data.__readers, &r, rnew))
+		    {
+		      if ((r & PTHREAD_RWLOCK_RWAITING)
+			  != (rnew & PTHREAD_RWLOCK_RWAITING))
+			futex_wake (&rwlock->__data.__readers, INT_MAX,
+				    private);
+		      return err;
+		    }
 		  /* TODO Back-off.  */
 		}
 	      /* Use the acquire MO fence to mirror the steps taken in the
