mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
This patch extracts page buffer pooling and the simple
least-recently-used strategy from clog.c into slru.c. It doesn't change any visible behaviour and passes all regression tests plus a TruncateCLOG test done manually. Apart from refactoring I made a little change to SlruRecentlyUsed, formerly ClogRecentlyUsed: It now skips incrementing lru_counts, if slotno is already the LRU slot, thus saving a few CPU cycles. To make this work, lru_counts are initialised to 1 in SimpleLruInit. SimpleLru will be used by pg_subtrans (part of the nested transactions project), so the main purpose of this patch is to avoid future code duplication. Manfred Koizar
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.14 2002/09/25 20:31:40 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.15 2003/06/11 22:37:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -108,8 +108,8 @@ NumLWLocks(void)
|
||||
/* bufmgr.c needs two for each shared buffer */
|
||||
numLocks += 2 * NBuffers;
|
||||
|
||||
/* clog.c needs one per CLOG buffer */
|
||||
numLocks += NUM_CLOG_BUFFERS;
|
||||
/* clog.c needs one per CLOG buffer + one control lock */
|
||||
numLocks += NUM_CLOG_BUFFERS + 1;
|
||||
|
||||
/* Perhaps create a few more for use by user-defined modules? */
|
||||
|
||||
|
Reference in New Issue
Block a user