Re: Way to check whether a particular block is on the shared_buffer? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Way to check whether a particular block is on the shared_buffer?
Date
Msg-id CA+TgmoamaGjAU5fPzwwEX=zNsoadZVtOUjTxXdUr+aN5a6dEug@mail.gmail.com
Whole thread Raw
In response to Re: Way to check whether a particular block is on the shared_buffer?  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: Way to check whether a particular block is on the shared_buffer?
List pgsql-hackers
On Tue, Feb 9, 2016 at 6:35 PM, Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:
> Unfortunately, it was not sufficient.
>
> Due to the assumption, the buffer page to be suspended does not exist
> when a backend process issues a series P2P DMA command. (If block would
> be already loaded to the shared buffer, it don't need to issue P2P DMA,
> but just use usual memory<->device DMA because RAM is much faster than
> SSD.)
> It knows the pair of (rel,fork,block), but no BufferDesc of this block
> exists. Thus, it cannot acquire locks in BufferDesc structure.
>
> Even if the block does not exist at this point, concurrent process may
> load the same page. BufferDesc of this page shall be assigned at this
> point, however, here is no chance to lock something in BufferDesc for
> the process which issues P2P DMA command.
>
> It is the reason why I assume the suspend/resume mechanism shall take
> a pair of (rel,fork,block) as identifier of the target block.

I see the problem, but I'm not terribly keen on putting in the hooks
that it would take to let you solve it without hacking core.  It
sounds like an awfully invasive thing for a pretty niche requirement.

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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: PL/Pythonu - function ereport
Next
From: Tom Lane
Date:
Subject: Re: Improve docs wrt catalog object ACLs