Re: LogwrtResult contended spinlock

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
Subject: Re: LogwrtResult contended spinlock
Date: 2021-11-22 21:56:43
Message-ID: 202111222156.xmo2yji5ifi2@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There was an earlier comment by Andres that asyncXactLSN should also be
atomic, to avoid an ugly spinlock interaction with the new atomic-based
logwrtResult. The 0002 here is an attempt at doing that; I found that
it also needed to change WalWriterSleeping to use atomics, to avoid
XLogSetAsyncXactLSN having to grab the spinlock for that.

--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
"Learn about compilers. Then everything looks like either a compiler or
a database, and now you have two problems but one of them is fun."
https://twitter.com/thingskatedid/status/1456027786158776329

Attachment Content-Type Size
v5-0001-make-LogwrtResult-atomic.patch text/x-diff 21.0 KB
v5-0002-more-atomics.patch text/x-diff 4.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-11-22 22:32:21 Re: Reduce function call costs on ELF platforms
Previous Message Andres Freund 2021-11-22 21:50:48 Reduce function call costs on ELF platforms