Need help with phys backed shm segments (Postgresql+FreeBSD). - Mailing list pgsql-hackers

From Alfred Perlstein
Subject Need help with phys backed shm segments (Postgresql+FreeBSD).
Date
Msg-id 20001205071458.U8051@fw.wintelcom.net
Whole thread Raw
Responses Re: Need help with phys backed shm segments (Postgresql+FreeBSD).  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On FreeBSD 4.1.1 and above there's a sysctl tunable called
kern.ipc.shm_use_phys, when set to 1 it's supposed to
make the kernel's handling of shared memory much more
effecient at the expense or making the shm segment unpageable.

I tried to use this option with 7.0.3 and FreeBSD 4.2 but
for some reason spinlocks keep getting mucked up (there's
a log at the tail end of this message).

Anyone using Postgresql on FreeBSD probably wants this to work,
otherwise using extremely large chunks of shm and many backends
active can exhaust kernel memory.

I was wondering if any of the more experienced developers could
take a look at what's happenening here.

Here's the log, the number in parens is the address of the lock,
on tas() the value printed to the right is the value in _ret,
for the others, it's the value before the lock count is set.

S_INIT_LOCK: (0x30048008) -> 0
S_UNLOCK: (0x30048008) -> 0
S_INIT_LOCK: (0x3004800c) -> 0
S_UNLOCK: (0x3004800c) -> 0
S_INIT_LOCK: (0x30048010) -> 0
S_UNLOCK: (0x30048010) -> 0
S_INIT_LOCK: (0x30048011) -> 0
S_UNLOCK: (0x30048011) -> 0
S_INIT_LOCK: (0x30048012) -> 0
S_UNLOCK: (0x30048012) -> 0
S_INIT_LOCK: (0x30048018) -> 0
S_UNLOCK: (0x30048018) -> 0
S_INIT_LOCK: (0x3004801c) -> 0
S_UNLOCK: (0x3004801c) -> 0
S_INIT_LOCK: (0x3004801d) -> 1
S_UNLOCK: (0x3004801d) -> 1
S_INIT_LOCK: (0x3004801e) -> 0
S_UNLOCK: (0x3004801e) -> 0
S_INIT_LOCK: (0x30048024) -> 127
S_UNLOCK: (0x30048024) -> 127
S_INIT_LOCK: (0x30048028) -> 255
S_UNLOCK: (0x30048028) -> 255
S_INIT_LOCK: (0x30048029) -> 0
S_UNLOCK: (0x30048029) -> 0
S_INIT_LOCK: (0x3004802a) -> 0
S_UNLOCK: (0x3004802a) -> 0
S_INIT_LOCK: (0x30048030) -> 1
S_UNLOCK: (0x30048030) -> 1
S_INIT_LOCK: (0x30048034) -> 0
S_UNLOCK: (0x30048034) -> 0
S_INIT_LOCK: (0x30048035) -> 0
S_UNLOCK: (0x30048035) -> 0
S_INIT_LOCK: (0x30048036) -> 0
S_UNLOCK: (0x30048036) -> 0
S_INIT_LOCK: (0x3004803c) -> 50
S_UNLOCK: (0x3004803c) -> 50
S_INIT_LOCK: (0x30048040) -> 10
S_UNLOCK: (0x30048040) -> 10
S_INIT_LOCK: (0x30048041) -> 0
S_UNLOCK: (0x30048041) -> 0
S_INIT_LOCK: (0x30048042) -> 0
S_UNLOCK: (0x30048042) -> 0
S_INIT_LOCK: (0x30048048) -> 1
S_UNLOCK: (0x30048048) -> 1
S_INIT_LOCK: (0x3004804c) -> 80
S_UNLOCK: (0x3004804c) -> 80
S_INIT_LOCK: (0x3004804d) -> 1
S_UNLOCK: (0x3004804d) -> 1
S_INIT_LOCK: (0x3004804e) -> 0
S_UNLOCK: (0x3004804e) -> 0
S_INIT_LOCK: (0x30048054) -> 0
S_UNLOCK: (0x30048054) -> 0
S_INIT_LOCK: (0x30048058) -> 1
S_UNLOCK: (0x30048058) -> 1
S_INIT_LOCK: (0x30048059) -> 1
S_UNLOCK: (0x30048059) -> 1
S_INIT_LOCK: (0x3004805a) -> 0
S_UNLOCK: (0x3004805a) -> 0
S_INIT_LOCK: (0x30048060) -> 0
S_UNLOCK: (0x30048060) -> 0
S_INIT_LOCK: (0x30048064) -> 0
S_UNLOCK: (0x30048064) -> 0
S_INIT_LOCK: (0x30048065) -> 0
S_UNLOCK: (0x30048065) -> 0
S_INIT_LOCK: (0x30048066) -> 0
S_UNLOCK: (0x30048066) -> 0
S_INIT_LOCK: (0x3004806c) -> 0
S_UNLOCK: (0x3004806c) -> 0
S_INIT_LOCK: (0x30048070) -> 0
S_UNLOCK: (0x30048070) -> 0
S_INIT_LOCK: (0x30048071) -> 0
S_UNLOCK: (0x30048071) -> 0
S_INIT_LOCK: (0x30048072) -> 0
S_UNLOCK: (0x30048072) -> 0
S_INIT_LOCK: (0x30048078) -> 0
S_UNLOCK: (0x30048078) -> 0
S_INIT_LOCK: (0x3004807c) -> 0
S_UNLOCK: (0x3004807c) -> 0
S_INIT_LOCK: (0x3004807d) -> 0
S_UNLOCK: (0x3004807d) -> 0
S_INIT_LOCK: (0x3004807e) -> 0
S_UNLOCK: (0x3004807e) -> 0
tas (0x30048054) -> 0
tas (0x30048059) -> 0
tas (0x30048058) -> 0
S_UNLOCK: (0x30048054) -> 1
tas (0x30048048) -> 0
tas (0x3004804d) -> 0
tas (0x3004804c) -> 0
S_UNLOCK: (0x30048048) -> 1
tas (0x30048048) -> 0
S_UNLOCK: (0x3004804c) -> 1
S_UNLOCK: (0x3004804d) -> 1
S_UNLOCK: (0x30048048) -> 1
tas (0x30048048) -> 0
tas (0x3004804d) -> 0
tas (0x3004804c) -> 0
S_UNLOCK: (0x30048048) -> 1
tas (0x30048048) -> 0
S_UNLOCK: (0x3004804c) -> 1
S_UNLOCK: (0x3004804d) -> 1
S_UNLOCK: (0x30048048) -> 1
tas (0x30048048) -> 0
tas (0x3004804d) -> 4
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1
tas (0x3004804d) -> 1

repeats (it's stuck)


-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: LOCK Fixes/Break on FreeBSD 4.2-STABLE
Next
From: Alfred Perlstein
Date:
Subject: Re: Re: LOCK Fixes/Break on FreeBSD 4.2-STABLE