Re: LWLock contention: I think I understand the problem - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: LWLock contention: I think I understand the problem
Date
Msg-id 3C2E1852.F2E6DF82@fourpalms.org
Whole thread Raw
In response to LWLock contention: I think I understand the problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: LWLock contention: I think I understand the problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
...
> It would seem, therefore, that lwlock.c's behavior of immediately
> granting the lock to released waiters is not such a good idea after all.
> Perhaps we should release waiters but NOT grant them the lock; when they
> get to run, they have to loop back, try to get the lock, and possibly go
> back to sleep if they fail.  This apparent waste of cycles is actually
> beneficial because it saves context swaps overall.

Hmm. Seems reasonable. In some likely scenerios, it would seem that the
waiters *could* grab the lock when they are next scheduled, since the
current locker would have finished at least one
grab/release/grab/release cycle in the meantime.

How hard will it be to try this out?
                   - Thomas


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: LWLock contention: I think I understand the problem
Next
From: Bruce Momjian
Date:
Subject: Re: LWLock contention: I think I understand the problem