7912 nfs_rwlock readers are running wild waiting for a writer that cannot come
Review Request #385 - Created Feb. 28, 2017 and submitted
Fix for #7601 assumed that cv_wait(9f)/cv_wait_sig(9f) places the calling thread at the end of the waiting queue while cv_signal(9f) always wakes up the first waiting thread in the queue. The implementation is not so straightforward and thread priorities are considered too. Threads with higher priority are queued before lower priority threads even they arrived after the lower priority threads. In a case the waiting writer had lower priority than waiting readers the waiting writer was never woken up and the readers were running in a neverending loop signalling each other in a hope one of the woken up thread will be the writer.
I ran the test described in bug #7601 to make sure the performance of the nfs_rwlock implementation didn't regress with this fix.
Review request changed
Status: Closed (submitted)
commit 7909625fdb7ecb20e9b7a777cfc0ec7ee63b4642 Author: Marcel Telka <email@example.com> AuthorDate: Tue Feb 28 12:19:19 2017 +0100 Commit: Robert Mustacchi <firstname.lastname@example.org> CommitDate: Wed Mar 22 21:08:11 2017 +0000 7912 nfs_rwlock readers are running wild waiting for a writer that cannot come Reviewed by: Arne Jansen <email@example.com> Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com> Approved by: Robert Mustacchi <firstname.lastname@example.org> :100644 100644 7ffb459... 9684466... M usr/src/uts/common/fs/nfs/nfs_subr.c :100644 100644 fc85e2e... b790b03... M usr/src/uts/common/nfs/rnode.h