Skip site navigation (1) Skip section navigation (2)

Re: LWLock contention: I think I understand the problem

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org, jwbaker(at)acm(dot)org
Subject: Re: LWLock contention: I think I understand the problem
Date: 2002-01-03 07:20:16
Message-ID: 200201030720.g037KG121082@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-odbc
Tom Lane wrote:
> I have thought of a further refinement to the patch I produced
> yesterday.  Assume that there are multiple waiters blocked on (eg)
> BufMgrLock.  After we release the first one, we want the currently
> running process to be able to continue acquiring and releasing the lock
> for as long as its time quantum holds out.  But in the patch as given,
> each acquire/release cycle releases another waiter.  This is probably
> not good.
> 
> Attached is a modification that prevents additional waiters from being
> released until the first releasee has a chance to run and acquire the
> lock.  Would you try this and see if it's better or not in your test
> cases?  It doesn't seem to help on a single CPU, but maybe on multiple
> CPUs it'll make a difference.
> 
> To try to make things simple, I've attached the mod in two forms:
> as a diff from current CVS, and as a diff from the previous patch.

This does seem like a nice optimization.  I will try to test it tomorrow
but I doubt I will see any change on BSD/OS.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Marko KreenDate: 2002-01-03 07:21:05
Subject: Re: pgcryto failures on freebsd/alpha
Previous:From: Bruce MomjianDate: 2002-01-03 06:37:19
Subject: Re: PGSQL - FAQ 4.1

pgsql-odbc by date

Next:From: Bruce MomjianDate: 2002-01-03 07:55:26
Subject: Re: LWLock contention: I think I understand the problem
Previous:From: Tatsuo IshiiDate: 2002-01-03 01:18:25
Subject: Re: LWLock contention: I think I understand the problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group