Re: LWLock deadlock and gdb advice - Mailing list pgsql-hackers

From Andres Freund
Subject Re: LWLock deadlock and gdb advice
Date
Msg-id 20150630202443.GL20882@alap3.anarazel.de
Whole thread Raw
In response to Re: LWLock deadlock and gdb advice  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: LWLock deadlock and gdb advice  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On 2015-06-30 22:19:02 +0300, Heikki Linnakangas wrote:
> >Hm. Right. A recheck of the value after the queuing should be sufficient
> >to fix? That's how we deal with the exact same scenarios for the normal
> >lock state, so that shouldn't be very hard to add.
> 
> Yeah. It's probably more efficient to not release the spinlock between
> checking the value and LWLockQueueSelf() though.

Right now LWLockQueueSelf() takes spinlocks etc itself, and is used that
way in a bunch of callsites... So that'd be harder.  Additionally I'm
planning to get rid of the spinlocks around queuing (they show up as
bottlenecks in contended workloads), so it seems more future proof not
to assume that either way.  On top of that I think we should, when
available (or using the same type of fallback as for 32bit?), use 64 bit
atomics for the var anyway.

> I'll take a stab at fixing this tomorrow.

Thanks! Do you mean both or "just" the second issue?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Franck Verrot
Date:
Subject: Mention column name in error messages
Next
From: Jeff Janes
Date:
Subject: Re: pg_trgm version 1.2