Re: [COMMITTERS] pgsql: Remove extra copies of LogwrtResult.

Lists: pgsql-committerspgsql-hackers
From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove extra copies of LogwrtResult.
Date: 2012-03-06 08:18:58
Message-ID: E1S4pbm-0003WR-NY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Remove extra copies of LogwrtResult.

This simplifies the code a little bit. The new rule is that to update
XLogCtl->LogwrtResult, you must hold both WALWriteLock and info_lck, whereas
before we had two copies, one that was protected by WALWriteLock and another
protected by info_lck. The code that updates them was already holding both
locks, so merging the two is trivial.

The third copy, XLogCtl->Insert.LogwrtResult, was not totally redundant, it
was used in AdvanceXLInsertBuffer to update the backend-local copy, before
acquiring the info_lck to read the up-to-date value. But the value of that
seems dubious; at best it's saving one spinlock acquisition per completed
WAL page, which is not significant compared to all the other work involved.
And in practice, it's probably not saving even that much.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7714c6382941383514c0f1954ca831686ac4fcd2

Modified Files
--------------
src/backend/access/transam/xlog.c | 74 +++++++++++--------------------------
1 files changed, 22 insertions(+), 52 deletions(-)


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Remove extra copies of LogwrtResult.
Date: 2012-03-06 12:06:20
Message-ID: CAHGQGwFGE8xDAN4E4M91vMJbRrvVgb0UMoRPEGSDVu8kE51HAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, Mar 6, 2012 at 5:18 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)iki(dot)fi> wrote:
> Remove extra copies of LogwrtResult.

I found one typo. Attached patch fixes that.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
fix_typo.patch text/x-diff 631 bytes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Remove extra copies of LogwrtResult.
Date: 2012-03-06 13:24:18
Message-ID: CA+TgmoYngpPY4t=AZf_PuuUcwUjMp0f-+NScVZ27GMfP-hyDGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, Mar 6, 2012 at 7:06 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Mar 6, 2012 at 5:18 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)iki(dot)fi> wrote:
>> Remove extra copies of LogwrtResult.
>
> I found one typo. Attached patch fixes that.

Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company