Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obj: remove hand-made spinlock from get_lane #4392

Open
pbalcer opened this issue Jan 7, 2020 · 0 comments
Open

obj: remove hand-made spinlock from get_lane #4392

pbalcer opened this issue Jan 7, 2020 · 0 comments
Labels
DAOS DAOS-related libpmemobj src/libpmemobj Priority: 4 low Type: Bug A previously unknown bug in PMDK

Comments

@pbalcer
Copy link
Member

pbalcer commented Jan 7, 2020

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.

@pbalcer pbalcer added the Type: Bug A previously unknown bug in PMDK label Jan 7, 2020
@marcinslusarz marcinslusarz added the libpmemobj src/libpmemobj label Mar 31, 2020
@janekmi janekmi added the DAOS DAOS-related label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DAOS DAOS-related libpmemobj src/libpmemobj Priority: 4 low Type: Bug A previously unknown bug in PMDK
Projects
None yet
Development

No branches or pull requests

4 participants