Re: Do we need so many hint bits?

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>
Subject: Re: Do we need so many hint bits?
Date: 2012-11-19 18:20:24
Message-ID: CAOeZVieq+1wLqgqk7n+L4vYAYin9cu=vq0PEYUtWtKi3dENAaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 18, 2012 at 10:43 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> On Sun, 2012-11-18 at 15:19 +0100, Andres Freund wrote:
> > On Sunday, November 18, 2012 03:07:01 AM Jeff Davis wrote:
> > > Process A (process that clears a VM bit for a data page):
> > > 1. Acquires exclusive lock on data buffer
> > > 2. Acquires exclusive lock on VM buffer
> > > 3. clears VM bit
> > > 4. Releases VM buffer lock
> > > 5. Releases data buffer lock
> >
> > Well, but right this is a rather big difference. If vm pages get
> > unconditionally locked all the time we will have a huge source of new
> > contention as they are shared between so many heap pages.
>
> No, that is only for the process *clearing* the bit, and this already
> happens. I am not planning on introducing any new locks, aside from the
> buffer header lock when acquiring a pin. And I plan to keep those pins
> for long enough that those don't matter, either.
>
> Regards,
> Jeff Davis
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

Sorry If I am being a bit naive, but shouldnt a simple mutex work in the
case when a process wants to change the VM bit in cache?

Mutex would be cheaper than locks.

Atri

--
Regards,

Atri
*l'apprenant*

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atri Sharma 2012-11-19 18:29:16 Re: Do we need so many hint bits?
Previous Message Josh Berkus 2012-11-19 18:01:51 Re: Materialized views WIP patch