Re: pgsql: Improve performance of subsystems on top of SLRU - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgsql: Improve performance of subsystems on top of SLRU
Date
Msg-id 3396247.1709500489@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Improve performance of subsystems on top of SLRU  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: pgsql: Improve performance of subsystems on top of SLRU
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> And I think it's correct that this is somewhat bogus, or at least
> confusing: the only way to have control back here on line 1371 after
> having executed once is via the "goto retry" line below; and there we
> release "prevlock" and set it to NULL beforehand, so it's impossible for
> prevlock to be NULL.  Looking closer I think this code is all confused,
> so I suggest to rework it as shown in the attached patch.

This is certainly simpler, but I notice that it holds the current
LWLock across the line

     ptr = (MultiXactMember *) palloc(length * sizeof(MultiXactMember));

where the old code did not.  Could the palloc take long enough that
holding the lock is bad?

Also, with this coding the "lock = NULL;" assignment just before
"goto retry" is a dead store.  Not sure if Coverity or other static
analyzers would whine about that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Shared detoast Datum proposal
Next
From: Nathan Bossart
Date:
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation