Re: Deadlock in XLogInsert at AIX

Konstantin Knizhnik <k.knizhnik@postgrespro.ru>

From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: "REIX, Tony" <tony.reix@atos.net>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Bernd Helmle <mailings@oopsware.de>
Date: 2017-02-02T16:27:53Z
Lists: pgsql-hackers
Hi Tony,

On 02.02.2017 17:10, REIX, Tony wrote:
>
> Hi Konstantin
>
> I've discussed the "zombie/exit" issue with our expert here.
>
> - He does not think that AIX has anything special here
>
> - If the process is marked <exiting> in ps, this is because the flag 
> SEXIT is set, thus the process is blocked somewhere in the kexitx() 
> syscall, waiting for something.
>
> - In order to know what it is waiting for, the best would be to have a 
> look with *kdb*.
>

kdb shows the following stack:

pvthread+073000 STACK:
[005E1958]slock+000578 (00000000005E1958, 8000000000001032 [??])
[00009558].simple_lock+000058 ()
[00651DBC]vm_relalias+00019C (??, ??, ??, ??, ??)
[006544AC]vm_map_entry_delete+00074C (??, ??, ??)
[00659C30]vm_map_delete+000150 (??, ??, ??, ??)
[00659D88]vm_map_deallocate+000048 (??, ??)
[0011C588]kexitx+001408 (??)
[000BB08C]kexit+00008C ()
___ Recovery (FFFFFFFFFFF9290) ___
WARNING: Eyecatcher/version mismatch in RWA


-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. For all ppc compilers, implement compare_exchange and fetch_add with asm.

  2. For PowerPC instruction "addi", use constraint "b".

  3. For all ppc compilers, implement pg_atomic_fetch_add_ with inline asm.

  4. Replace xlc __fetch_and_add() with inline asm.

  5. Test pg_atomic_fetch_add_ with variable addend and 16-bit edge cases.