SVNews r330414

NOTE: This service is experimental and subject to change! Use at your own risk!

2018-03-04 21:38:30 - r330414 by mjg (Mateusz Guzik)

Complete list of files affected by revision r330414:

(Note: At the moment, these links point to ViewVC on They are probably slow. Do not overuse.)

  History   Contents   Diff   MODIFY   /head/sys/kern/kern_rwlock.c  
  History   Contents   Diff   MODIFY   /head/sys/kern/kern_sx.c  

Commit message:

locks: fix a corner case in r327399

If there were exactly rowner_retries/asx_retries (by default: 10) transitions
between read and write state and the waiters still did not get the lock, the
next owner -> reader transition would result in the code correctly falling
back to turnstile/sleepq where it would incorrectly think it was waiting
for a writer and decide to leave turnstile/sleepq to loop back. From this
point it would take ts/sq trips until the lock gets released.

The bug sometimes manifested itself in stalls during -j 128 package builds.

Refactor the code to fix the bug, while here remove some of the gratituous
differences between rw and sx locks.


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 4 ms, 2 files printed. Current time is 2018-03-18 11:49:52. All times are in UTC/GMT.