Re: Change BgWriterCommLock to spinlock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Change BgWriterCommLock to spinlock
Date: 2006-01-08 23:22:22
Message-ID: 24000.1136762542@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> 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();

Spinlock-based coding is inherently much more fragile than LWLock-based
coding. I'm against changing things in that direction unless a
substantial performance improvement can be gained. You didn't offer
any evidence of improvement at all.

> (2) Don't need the CRITICAL SECTION in AbsorbFsyncRequests() any more;

Really? I think this coding still breaks, rather badly, if
RememberFsyncRequest fails. Certainly the reasons for needing a
critical section have nothing to do with what kind of lock is used.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Qingqing Zhou 2006-01-08 23:32:49 Re: Change BgWriterCommLock to spinlock
Previous Message Qingqing Zhou 2006-01-08 22:57:51 Re: Change BgWriterCommLock to spinlock