The following patch changes BgWriterCommLock to a spinlock. To confirm to
the spinlock coding rules(though not needed since we are in critical
section), rewrite the requests array into a circular one, which will
reduce the lock time when the bgwriter absorbs the requests. A
byproduct-benefit is
Qingqing Zhou [EMAIL PROTECTED] writes:
The following patch changes BgWriterCommLock to a spinlock.
Why is this a good idea?
regards, tom lane
---(end of broadcast)---
TIP 4: Have you searched our list archives?
On Sun, 8 Jan 2006, Tom Lane wrote:
Why is this a good idea?
In spirit of incremental improvement:
(1) The spinlock itself are light weight than the LWLock here and we can
reduce the lock contention a little bit in AbsorbFsyncRequests();
(2) Don't need the CRITICAL SECTION in
Qingqing Zhou [EMAIL PROTECTED] writes:
On Sun, 8 Jan 2006, Tom Lane wrote:
Why is this a good idea?
In spirit of incremental improvement:
(1) The spinlock itself are light weight than the LWLock here and we can
reduce the lock contention a little bit in AbsorbFsyncRequests();
On Sun, 8 Jan 2006, Tom Lane wrote:
(1) The spinlock itself are light weight than the LWLock here and we
can reduce the lock contention a little bit in AbsorbFsyncRequests();
Spinlock-based coding is inherently much more fragile than LWLock-based
coding. I'm against changing things in
Qingqing Zhou [EMAIL PROTECTED] writes:
Yeah, only theoretically there is some marginal performance improvements.
Maybe you suggest we keep the LWLock but use the circular array part?
They're separable issues anyway.
Yeah, not related to lock. But I changed algorithm to circular array as
On Sun, 8 Jan 2006, Tom Lane wrote:
If you want the bgwriter to keep working in the face of an out-of-memory
condition in the hashtable, I think you'd have to change the coding so
that it takes requests one at a time from the queue.
Patched version will issue ERROR instead of PANIC at this
Qingqing Zhou [EMAIL PROTECTED] writes:
Do you suggest it makes sense that we continue to work on the patch or let
it be?
I don't see any problem here that urgently needs solving. If we ever
see any reports of out-of-memory failures in the bgwriter, then it'll
be time to worry about this, but
On Sun, 8 Jan 2006, Tom Lane wrote:
I don't see any problem here that urgently needs solving. If we ever
see any reports of out-of-memory failures in the bgwriter, then it'll
be time to worry about this, but I think it quite unlikely that we
ever will. (Even if we do, a simpler answer