obj: remove hand-made spinlock from get_lane #4392
Labels
DAOS
DAOS-related
libpmemobj
src/libpmemobj
Priority: 4 low
Type: Bug
A previously unknown bug in PMDK
We currently use a hand-made spinlock for waiting for lanes when none are available. This decision was made because we assumed that this situation is extremely unlikely. However, in scenarios where there are more threads than lanes, we should allow the OS to work with the library, not against it, with optimally scheduling the threads so that the available lanes are properly utilized.
This is a reflection I had after reading these posts:
https://probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is/
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189723
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189747
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189752
(I highly recommend reading these)
We should probably replace the current code with a semaphore, and luckily, we already have an abstraction for that in
sys_util.h
.The text was updated successfully, but these errors were encountered: