Page MenuHomePhabricator

Reduce collision rate for concurrency-limiting slot locks
ClosedPublic

Authored by epriestley on Feb 13 2018, 5:53 PM.
Tags
None
Referenced Files
F14076387: D19078.diff
Thu, Nov 21, 5:05 PM
Unknown Object (File)
Sun, Nov 17, 4:43 PM
Unknown Object (File)
Fri, Nov 15, 4:50 PM
Unknown Object (File)
Wed, Nov 13, 5:27 PM
Unknown Object (File)
Sat, Nov 9, 9:26 PM
Unknown Object (File)
Wed, Nov 6, 3:07 PM
Unknown Object (File)
Sat, Oct 26, 1:11 AM
Unknown Object (File)
Wed, Oct 23, 11:57 PM
Subscribers
Restricted Owners Package

Details

Summary

Depends on D19077. Ref T13073. When we're using slot locks to enforce a limit (e.g., maximum of 5 simultaneous things) we currently load locks owned by the blueprint to identify which slots are likely to be free.

However, this isn't right: the blueprint doesn't own these locks. The resources do.

We still get the right behavior eventually, but we incorrectly identify that every slot lock is always free, so as the slots fill up we'll tend to guess wrong more and more often.

Instead, load the slot locks by name explicitly.

Test Plan

Implemented lock-based limiting on HoaxBlueprint, var_dump()'d the candidate locks, saw correct test state for locks. Acquired leases without releasing, got all of the slots filled without any slot lock collisions (previously, the last slot or two tended to collide a lot).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable