[pbs-devel] [RFC PATCH 0/5] fix #3935: refactor datastore locking to use tmpfs
Wolfgang Bumiller
w.bumiller at proxmox.com
Tue Mar 22 10:57:57 CET 2022
On Tue, Mar 22, 2022 at 10:46:20AM +0100, Dietmar Maurer wrote:
> > - A "hashmap lock file": An in-memory file filled with robust-futex
> > where the group name simply gets hashed to get to a positioin in the
> > file. Hash clashes aren't an issue since all they'd do is cause
> > multiple groups to be guarded by the same lock, which wouldn't
> > technically be wrong.
>
> Just want to note that above approach could lead to unexpected deadlocks with hash clashes, so I guess it is not that simple to get it right...
Although this depends on the exact use case. For the most part you can
get away with checking whether the mutexes are the same, or probably
with just setting the mutex type to be recursive to allow the same
thread to lock it multiple times.
More information about the pbs-devel
mailing list