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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Fix spinlock usage in UnpinBuffer()



There is no LWLock protecting the spinlock in UnpinBuffer(), so we need do
so ourselves. I also checked other NoHoldOff spinlock, seems they are ok.

Regards,
Qingqing

Index: bufmgr.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v
retrieving revision 1.200
diff -c -r1.200 bufmgr.c
*** bufmgr.c	22 Nov 2005 18:17:19 -0000	1.200
--- bufmgr.c	28 Dec 2005 09:33:18 -0000
***************
*** 812,817 ****
--- 812,818 ----
  		Assert(!LWLockHeldByMe(buf->io_in_progress_lock));

  		/* NoHoldoff ensures we don't lose control before sending signal */
+ 		HOLD_INTERRUPTS();
  		LockBufHdr_NoHoldoff(buf);

  		/* Decrement the shared reference count */
***************
*** 847,852 ****
--- 848,856 ----
  		else
  			UnlockBufHdr_NoHoldoff(buf);

+ 		/* safe to accept interrupts now */
+ 		RESUME_INTERRUPTS();
+
  		/*
  		 * If VACUUM is releasing an otherwise-unused buffer, send it to the
  		 * freelist for near-term reuse.  We put it at the tail so that it




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group