Re: Wait free LW_SHARED acquisition - v0.9
От | Andres Freund |
---|---|
Тема | Re: Wait free LW_SHARED acquisition - v0.9 |
Дата | |
Msg-id | 20141008133533.GA5053@alap3.anarazel.de обсуждение исходный текст |
Ответ на | Wait free LW_SHARED acquisition (Andres Freund <andres@2ndquadrant.com>) |
Ответы |
Re: Wait free LW_SHARED acquisition - v0.9
Re: Wait free LW_SHARED acquisition - v0.9 Re: Wait free LW_SHARED acquisition - v0.9 Re: Wait free LW_SHARED acquisition - v0.9 |
Список | pgsql-hackers |
Hi, Attached you can find the next version of my LW_SHARED patchset. Now that atomics are committed, it seems like a good idea to also add their raison d'être. Since the last public version I have: * Addressed lots of Amit's comments. Thanks! * Peformed a fair amount of testing. * Rebased the code. The volatile removal made that not entirely trivial... * Significantly cleaned up and simplified the code. * Updated comments and such * Fixed a minor bug (unpaired HOLD/RESUME_INTERRUPTS in a corner case) The feature currently consists out of two patches: 1) Convert PGPROC->lwWaitLink into a dlist. The old code was frail and verbose. This also does: * changes the logic in LWLockRelease() to release all shared lockers when waking up any. This can yield some significant performance improvements - and the fairness isn't really much worse than before, as we always allowed new shared lockers to jump the queue. * adds a memory pg_write_barrier() in the wakeup paths between dequeuing and unsetting ->lwWaiting. That was always required on weakly ordered machines, but f4077cda2 made it more urgent. I can reproduce crashes without it. 2) Implement the wait free LW_SHARED algorithm. Personally I'm quite happy with the new state. I think it needs more review, but I personally don't know of anything that needs changing. There's lots of further improvements that could be done, but let's get this in first. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Вложения
В списке pgsql-hackers по дате отправления: