Skip to content

Commit c0e9b31

Browse files
committed
Hmm, seems --disable-spinlocks has been broken for awhile and nobody
noticed. Fix SpinlockSemas() to report the correct count considering that PG 8.1 adds a spinlock to each shared-buffer header.
1 parent 98359c3 commit c0e9b31

File tree

1 file changed

+5
-3
lines changed
  • src/backend/storage/lmgr

1 file changed

+5
-3
lines changed

src/backend/storage/lmgr/spin.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.20 2006/07/14 14:52:23 momjian Exp $
19+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.21 2006/07/22 21:04:40 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
2323
#include "postgres.h"
2424

25+
#include "miscadmin.h"
26+
#include "storage/lwlock.h"
2527
#include "storage/spin.h"
2628

2729

@@ -53,9 +55,9 @@ SpinlockSemas(void)
5355
* similar to the way shmem space estimation is handled.
5456
*
5557
* For now, though, we just need a few spinlocks (10 should be plenty)
56-
* plus one for each LWLock.
58+
* plus one for each LWLock and one for each buffer header.
5759
*/
58-
return NumLWLocks() + 10;
60+
return NumLWLocks() + NBuffers + 10;
5961
}
6062

6163
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy