Tweak LWLock algorithms so that an awakened waiter for a lock is not granted the lock when awakened; the signal now only means that the lock is potentially available.  The waiting process must retry its attempt to get the lock when it gets to run.  This allows the lock releasing process to re-acquire the lock later in its timeslice.  Since LWLocks are usually held for short periods, it is possible for a process to acquire and release the same lock many times in a timeslice.  The old spinlock-based implementation of these locks allowed for that; but the original coding of LWLock would force a process swap for each acquisition if there was any contention.  Although this approach reopens the door to process starvation (a waiter might repeatedly fail to get the lock), the odds of that being a big problem seem low, and the performance cost of the previous approach is considerable.
Tweak LWLock algorithms so that an awakened waiter for a lock is not
granted the lock when awakened; the signal now only means that the lock
is potentially available.  The waiting process must retry its attempt
to get the lock when it gets to run.  This allows the lock releasing
process to re-acquire the lock later in its timeslice.  Since LWLocks
are usually held for short periods, it is possible for a process to
acquire and release the same lock many times in a timeslice.  The old
spinlock-based implementation of these locks allowed for that; but the
original coding of LWLock would force a process swap for each acquisition
if there was any contention.  Although this approach reopens the door to
process starvation (a waiter might repeatedly fail to get the lock),
the odds of that being a big problem seem low, and the performance cost
of the previous approach is considerable.

xinzweb/gpdb,Chibin/gpdb,ashwinstar/gpdb,ovr/postgres-xl,edespino/gpdb,zeroae/postgres-xl,adam8157/gpdb,snaga/postgres-xl,adam8157/gpdb,rubikloud/gpdb,edespino/gpdb,rvs/gpdb,adam8157/gpdb,atris/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,xuegang/gpdb,tangp3/gpdb,lintzc/gpdb,snaga/postgres-xl,0x0FFF/gpdb,foyzur/gpdb,xuegang/gpdb,Quikling/gpdb,yuanzhao/gpdb,50wu/gpdb,Quikling/gpdb,ahachete/gpdb,randomtask1155/gpdb,yazun/postgres-xl,0x0FFF/gpdb,snaga/postgres-xl,rubikloud/gpdb,chrishajas/gpdb,rvs/gpdb,cjcjameson/gpdb,chrishajas/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,janebeckman/gpdb,adam8157/gpdb,foyzur/gpdb,edespino/gpdb,yazun/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,kaknikhil/gpdb,zaksoup/gpdb,randomtask1155/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,edespino/gpdb,ahachete/gpdb,50wu/gpdb,yazun/postgres-xl,randomtask1155/gpdb,zaksoup/gpdb,50wu/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,tpostgres-projects/tPostgres,CraigHarris/gpdb,rubikloud/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,postmind-net/postgres-xl,adam8157/gpdb,randomtask1155/gpdb,ashwinstar/gpdb,rvs/gpdb,ovr/postgres-xl,yuanzhao/gpdb,zaksoup/gpdb,ashwinstar/gpdb,tangp3/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,Quikling/gpdb,chrishajas/gpdb,lisakowen/gpdb,janebeckman/gpdb,yuanzhao/gpdb,edespino/gpdb,lintzc/gpdb,rvs/gpdb,yuanzhao/gpdb,lintzc/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,kaknikhil/gpdb,foyzur/gpdb,adam8157/gpdb,janebeckman/gpdb,50wu/gpdb,50wu/gpdb,xuegang/gpdb,kmjungersen/PostgresXL,ovr/postgres-xl,tangp3/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,greenplum-db/gpdb,lpetrov-pivotal/gpdb,kaknikhil/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,0x0FFF/gpdb,foyzur/gpdb,yazun/postgres-xl,ashwinstar/gpdb,lpetrov-pivotal/gpdb,kaknikhil/gpdb,rubikloud/gpdb,postmind-net/postgres-xl,Chibin/gpdb,greenplum-db/gpdb,Quikling/gpdb,greenplum-db/gpdb,Quikling/gpdb,ashwinstar/gpdb,foyzur/gpdb,zaksoup/gpdb,jmcatamney/gpdb,tangp3/gpdb,ashwinstar/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,edespino/gpdb,yuanzhao/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,lintzc/gpdb,lintzc/gpdb,lisakowen/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,arcivanov/postgres-xl,zeroae/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,edespino/gpdb,Quikling/gpdb,xinzweb/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,zeroae/postgres-xl,yuanzhao/gpdb,postmind-net/postgres-xl,kmjungersen/PostgresXL,cjcjameson/gpdb,lintzc/gpdb,techdragon/Postgres-XL,janebeckman/gpdb,oberstet/postgres-xl,xinzweb/gpdb,yuanzhao/gpdb,atris/gpdb,yuanzhao/gpdb,zaksoup/gpdb,xinzweb/gpdb,CraigHarris/gpdb,ahachete/gpdb,foyzur/gpdb,lintzc/gpdb,cjcjameson/gpdb,xuegang/gpdb,ahachete/gpdb,0x0FFF/gpdb,tangp3/gpdb,janebeckman/gpdb,atris/gpdb,greenplum-db/gpdb,50wu/gpdb,oberstet/postgres-xl,cjcjameson/gpdb,postmind-net/postgres-xl,cjcjameson/gpdb,zaksoup/gpdb,atris/gpdb,Quikling/gpdb,0x0FFF/gpdb,Postgres-XL/Postgres-XL,cjcjameson/gpdb,snaga/postgres-xl,Quikling/gpdb,royc1/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,foyzur/gpdb,Chibin/gpdb,tpostgres-projects/tPostgres,0x0FFF/gpdb,snaga/postgres-xl,rvs/gpdb,xuegang/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,edespino/gpdb,ahachete/gpdb,tpostgres-projects/tPostgres,techdragon/Postgres-XL,xuegang/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,pavanvd/postgres-xl,arcivanov/postgres-xl,chrishajas/gpdb,tangp3/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,randomtask1155/gpdb,royc1/gpdb,arcivanov/postgres-xl,atris/gpdb,janebeckman/gpdb,lintzc/gpdb,ahachete/gpdb,zaksoup/gpdb,ahachete/gpdb,pavanvd/postgres-xl,lpetrov-pivotal/gpdb,adam8157/gpdb,Chibin/gpdb,rubikloud/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,royc1/gpdb,xinzweb/gpdb,janebeckman/gpdb,xuegang/gpdb,50wu/gpdb,ahachete/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,lisakowen/gpdb,zaksoup/gpdb,greenplum-db/gpdb,chrishajas/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,ovr/postgres-xl,kaknikhil/gpdb,chrishajas/gpdb,tangp3/gpdb,foyzur/gpdb,atris/gpdb,chrishajas/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,Postgres-XL/Postgres-XL,rvs/gpdb,xuegang/gpdb,Quikling/gpdb,rvs/gpdb,Chibin/gpdb,rvs/gpdb,yazun/postgres-xl,xinzweb/gpdb,randomtask1155/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,kmjungersen/PostgresXL,atris/gpdb,royc1/gpdb,royc1/gpdb,50wu/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,janebeckman/gpdb,lintzc/gpdb,tpostgres-projects/tPostgres,rvs/gpdb,Chibin/gpdb,ovr/postgres-xl,randomtask1155/gpdb,arcivanov/postgres-xl,randomtask1155/gpdb,lisakowen/gpdb,royc1/gpdb,xuegang/gpdb,Chibin/gpdb,CraigHarris/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,lpetrov-pivotal/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,Chibin/gpdb,xinzweb/gpdb,rvs/gpdb,lisakowen/gpdb,zeroae/postgres-xl,kaknikhil/gpdb,cjcjameson/gpdb,rubikloud/gpdb,edespino/gpdb,CraigHarris/gpdb,techdragon/Postgres-XL,rubikloud/gpdb,janebeckman/gpdb,atris/gpdb,Chibin/gpdb,greenplum-db/gpdb,kmjungersen/PostgresXL,chrishajas/gpdb,royc1/gpdb