Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-07-16 Thread Andres Freund
Hi, On 2025-07-16 18:27:45 +0300, Yura Sokolov wrote: > 16.07.2025 17:58, Andres Freund пишет: > >> Now, if I simply remove the spinlock in SIGetDataEntries, I see a drop of > >> just ~6% under concurrent DDL. I think this strongly suggests that the > >> spinlock is the bottleneck. > > > > This c

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-07-16 Thread Yura Sokolov
16.07.2025 17:58, Andres Freund пишет: > Hi, > > On 2025-06-25 16:41:46 +0300, Sergey Shinderuk wrote: >> On 16.06.2025 17:41, Andres Freund wrote: >>> TBH, I don't see a point in continuing with this thread without something >>> that >>> others can test. I rather doubt that the right fix here i

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-07-16 Thread Andres Freund
Hi, On 2025-06-25 16:41:46 +0300, Sergey Shinderuk wrote: > On 16.06.2025 17:41, Andres Freund wrote: > > TBH, I don't see a point in continuing with this thread without something > > that > > others can test. I rather doubt that the right fix here is to just change > > the > > lock model over,

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-25 Thread Sergey Shinderuk
On 16.06.2025 17:41, Andres Freund wrote: TBH, I don't see a point in continuing with this thread without something that others can test. I rather doubt that the right fix here is to just change the lock model over, but without a repro I can't evaluate that. Hello, I think I can reproduce th

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-16 Thread Andres Freund
Hi, On 2025-06-16 17:28:31 +0300, Yura Sokolov wrote: > 04.06.2025 00:04, Andres Freund пишет: > > Hi, > > > > On 2025-06-02 21:20:33 +0300, Yura Sokolov wrote: > >> But still problem of spin lock contention is here. > > > > I still would like to see a reproducer for this. > > For problem in si

Re: Read-Write optimistic lock (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-16 Thread Yura Sokolov
04.06.2025 00:04, Andres Freund пишет: > Hi, > > On 2025-06-02 21:20:33 +0300, Yura Sokolov wrote: >> But still problem of spin lock contention is here. > > I still would like to see a reproducer for this. For problem in sinvaladt.c we have no synthetic reproducer. But version with changed maxMs

Re: SpinLockAcquire and SpinLockRelease is broken on ARM/ARM64? (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-03 Thread Andres Freund
Hi, On 2025-06-02 21:20:33 +0300, Yura Sokolov wrote: > But still problem of spin lock contention is here. I still would like to see a reproducer for this. > So I propose to introduce another spin lock type capable for Exclusive and > Shared lock modes (i.e. Write/Read modes) and use it in this

Re: SpinLockAcquire and SpinLockRelease is broken on ARM/ARM64? (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-06-02 Thread Yura Sokolov
Good day, Andres. Good day, hackers. 05.05.2025 10:30, Yura Sokolov wrote: > 21.03.2025 19:33, Andres Freund пишет: >> Hi, >> >> On 2025-03-21 14:35:16 +0300, Yura Sokolov wrote: >>> From 080c9e0de5e6e10751347e1ff50b65df424744cb Mon Sep 17 00:00:00 2001 >>> From: Yura Sokolov >>> Date: Mon, 3 Feb

SpinLockAcquire and SpinLockRelease is broken on ARM/ARM64? (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)

2025-05-05 Thread Yura Sokolov
21.03.2025 19:33, Andres Freund пишет: > Hi, > > On 2025-03-21 14:35:16 +0300, Yura Sokolov wrote: >> From 080c9e0de5e6e10751347e1ff50b65df424744cb Mon Sep 17 00:00:00 2001 >> From: Yura Sokolov >> Date: Mon, 3 Feb 2025 11:58:33 +0300 >> Subject: [PATCH v2] sinvaladt.c: use atomic operations on m

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-03-25 Thread Yura Sokolov
25.03.2025 13:52, Yura Sokolov пишет: > Good day, Andres > > 24.03.2025 16:08, Andres Freund wrote: >> On 2025-03-24 13:41:17 +0300, Yura Sokolov wrote: >>> 21.03.2025 19:33, Andres Freund wrote: I'd also like to know a bit more about the motivation here - I can easily believe that you h

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-03-24 Thread Andres Freund
Hi, On 2025-03-24 13:41:17 +0300, Yura Sokolov wrote: > 21.03.2025 19:33, Andres Freund wrote: > > I'd also like to know a bit more about the motivation here - I can easily > > believe that you hit contention around the shared inval queue, but I find it > > somewhat hard to believe that a spinlock

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-03-24 Thread Yura Sokolov
Hi, Andres 21.03.2025 19:33, Andres Freund wrote: > Hi, > > On 2025-03-21 14:35:16 +0300, Yura Sokolov wrote: >> From 080c9e0de5e6e10751347e1ff50b65df424744cb Mon Sep 17 00:00:00 2001 >> From: Yura Sokolov >> Date: Mon, 3 Feb 2025 11:58:33 +0300 >> Subject: [PATCH v2] sinvaladt.c: use atomic ope

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-03-21 Thread Andres Freund
Hi, On 2025-03-21 14:35:16 +0300, Yura Sokolov wrote: > From 080c9e0de5e6e10751347e1ff50b65df424744cb Mon Sep 17 00:00:00 2001 > From: Yura Sokolov > Date: Mon, 3 Feb 2025 11:58:33 +0300 > Subject: [PATCH v2] sinvaladt.c: use atomic operations on maxMsgNum > > msgnumLock spinlock could be highly

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-03-21 Thread Yura Sokolov
Just rebased the patch. --- regards Yura Sokolov aka funny-falconFrom 080c9e0de5e6e10751347e1ff50b65df424744cb Mon Sep 17 00:00:00 2001 From: Yura Sokolov Date: Mon, 3 Feb 2025 11:58:33 +0300 Subject: [PATCH v2] sinvaladt.c: use atomic operations on maxMsgNum msgnumLock spinlock could be hig

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-02-04 Thread Yura Sokolov
03.02.2025 19:49, Heikki Linnakangas пишет: > On 03/02/2025 13:05, Yura Sokolov wrote: >> Investigating some performance issues of a client, our engineers found >> msgnumLock to be contended. >> >> Looking closer it is obvious it is not needed at all: it used only as >> memory barrier. It is even s

Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-02-03 Thread Heikki Linnakangas
On 03/02/2025 13:05, Yura Sokolov wrote: Investigating some performance issues of a client, our engineers found msgnumLock to be contended. Looking closer it is obvious it is not needed at all: it used only as memory barrier. It is even stated in comment at file start: * We deal with that by ha

sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum

2025-02-03 Thread Yura Sokolov
Good day, Investigating some performance issues of a client, our engineers found msgnumLock to be contended. Looking closer it is obvious it is not needed at all: it used only as memory barrier. It is even stated in comment at file start: * We deal with that by having a spinlock that readers mus