[PATCH] introduce XLogLockBlockRangeForCleanup()

From: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] introduce XLogLockBlockRangeForCleanup()
Date: 2014-06-13 08:40:12
Message-ID: 20140613084012.GA16567@toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

nbtxlog.c:btree_xlog_vacuum() contains the following comment:

* XXX we don't actually need to read the block, we just need to
* confirm it is unpinned. If we had a special call into the
* buffer manager we could optimise this so that if the block is
* not in shared_buffers we confirm it as unpinned.

The attached patch introduces an XLogLockBlockRangeForCleanup() function
that addresses this, as well as a "special call into the buffer manager"
that makes it possible to lock the buffers without reading them.

The patch is by Simon Riggs, with some minor edits and testing by me.

I'm adding the patch to the CommitFest, and will follow up with some
performance numbers soon.

-- Abhijit

Attachment Content-Type Size
XLogLockBlockRangeForCleanup.v3.patch text/x-diff 14.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-06-13 08:51:33 Re: Few observations in replication slots related code
Previous Message Michael Paquier 2014-06-13 08:25:06 Re: PL/pgSQL support to define multi variables once