]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sx: port over writer starvation prevention measures from rwlock
authormjg <mjg@FreeBSD.org>
Tue, 22 May 2018 07:20:22 +0000 (07:20 +0000)
committermjg <mjg@FreeBSD.org>
Tue, 22 May 2018 07:20:22 +0000 (07:20 +0000)
commit2eae2c18c9790555fe5a9cf5fed965de39b4a2ed
tree9fabd522eb18680ea620972b3955fe6f2768e0b0
parent30f6cb7019be2cb5364bc99e79fd89cb0987f32a
sx: port over writer starvation prevention measures from rwlock

A constant stream of readers could completely starve writers and this is not
a hypothetical scenario.

The 'poll2_threads' test from the will-it-scale suite reliably starves writers
even with concurrency < 10 threads.

The problem was run into and diagnosed by dillon@backplane.com

There was next to no change in lock contention profile during -j 128 pkg build,
despite an sx lock being at the top.

Tested by: pho
sys/kern/kern_sx.c
sys/kern/subr_trap.c
sys/sys/proc.h
sys/sys/sx.h