Re: WIP: "More fair" LWLocks

2018-09-09 Thread Dmitry Dolgov
> On Mon, 13 Aug 2018 at 17:36, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > > 2) lwlock-far-2.patch > New flag LW_FLAG_FAIR is introduced. This flag is set when first > shared locker in the row releases the lock. When LW_FLAG_FAIR is set > and there is already somebody in the queue,

Re: WIP: "More fair" LWLocks

2018-08-13 Thread Dmitry Dolgov
> On Mon, 13 Aug 2018 at 17:36, Alexander Korotkov > wrote: > > Hi! > > I run pgbench (read-write and read-only benchmarks) on Amazon > c5d.18xlarge virtual machine, which has 72 VCPU (approximately same > power as 36 physical cores). The results are attached > (lwlock-fair-ro.png and

WIP: "More fair" LWLocks

2018-08-13 Thread Alexander Korotkov
Hi! This subject was already raised multiple times [1], [2], [3]. In short, our LWLock implementation has pathological behavior when shared lockers constitute a continuous flood. In this case exclusive lock waiters are not guaranteed to eventually get the lock. When shared lock is held, other