Re: Design notes for BufMgrLock rewrite - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Design notes for BufMgrLock rewrite
Date
Msg-id 3635.1109029537@sss.pgh.pa.us
Whole thread Raw
In response to Re: Design notes for BufMgrLock rewrite  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Design notes for BufMgrLock rewrite  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> ...but do you agree with my comments on the lack of scalability in cache
> miss situations?

No.  Grabbing a lock during a cache miss is the least of your worries;
you're going to do I/O, or at least a kernel call, so it hardly matters
as long as you're not holding the lock for a time that's long in
comparison to that overhead.

The only test case I've seen that exposes a significant amount of bufmgr
contention is one that involves zero I/O (100% cache hit rate), so that
the fraction of time spent holding the BufMgrLock is a significant part
of the total time.  As soon as you move off 100%, the bufmgr isn't the
critical path anymore.  So I think the fact that this redesign is able
to reduce the contention at all in that case is just gravy.  (It does
reduce contention because ReleaseBuffer doesn't take a global lock
anymore, and because BufMappingLock and BufFreelistLock are separate
locks.)

If testing shows that we still have contention issues with this design
then we can try subdividing the BufFreelistLock --- but right now my
guess is that we'd just be giving up more cache management efficiency
in return for not much.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Design notes for BufMgrLock rewrite
Next
From: Tom Lane
Date:
Subject: Re: Design notes for BufMgrLock rewrite